joelanders / r6502

Assembler and simulator for the 6502 processor
MIT License
12 stars 3 forks source link

Implicit mode used instead of accumulator for shift operations? #2

Closed Aerlinger closed 10 years ago

Aerlinger commented 10 years ago

Hi, I saw that the assembler uses implicit modes for shift operations (ASL, LSR, etc) instead of accumulator mode (The defined behavior for these modes act on the data in the accumulator itself: http://www.6502.org/tutorials/6502opcodes.html#ASL). I was just wondering what the design justification was for this. Does it make the design at a high level simpler?

joelanders commented 10 years ago

Hi, sorry for the late response. I must have filtered all of my github notifications!

I think I remember taking some shortcuts because accumulator mode and implied mode look the same at the assembly-syntax level. (eg. ASL with no parameters looks the same as TAX with no parameters, even though the first is "accumulator addressing" and the second is "implied addressing").

Something like that. It was probably an embarrassing hack ;)