Comment by emptybits

Comment by emptybits 9 days ago

3 replies

I agree; I read the headline as meaning a 6502 assembler was written, as opposed to 6502 assembly being written.

Writing compilers gets difficult, quickly. But writing assemblers is/was common enough for simple architectures and it's quite fun and relatively easy to prove/test for correctness. At least compared to most compilers.

One of my first gigs out of school involved writing a Z80 assembler because I "needed" nonstandard (Sharp/DMG/8080) instructions to be handled during a codebase port. It was enjoyable! I recommend everyone write an 8-bit assembler at least once!

Still, TFA is very interesting and I appreciate OP's share. :-)

spc476 9 days ago

I wrote my own 6809 assembler [1] largely just because, and I ended up adding a 6809 emulator to it, so I can run tests during the assembly phase. I'm only aware of one other assembler (a 6502 one) that can do this. It's a fun project.

[1] https://github.com/spc476/a09

  • PaulHoule 9 days ago

    I’ve been thinking about how to add tests to assembly code, that looks like a good idea.

PaulHoule 9 days ago

There was the time I wrote a “data-assembler” for the AVR8 because I was packing up rather complicated data structures to represent parts of graphics that appear on a persistence of vision display and how the parts are assembled into images. If you look at any assembler you see there are a lot of facilities for constructing data as well as for constructing code and I took one approach to that problem, outputting C code for an array that the system can read out of the (comparatively large) ROM.