5 ms·
It doesn't support explicit accumulator addressing mode (ASL A, LSR A, ROL A, ROR A), but otherwise quite neat. (from a quick look at it) (also, 0x syntax is q
by GlitchMr 11y ago
It doesn't support explicit accumulator addressing mode (ASL A, LSR A, ROL A, ROR A), but otherwise quite neat. (from a quick look at it)
(also, 0x syntax is quite unusual, but I assume $ couldn't have been implemented for some reason)
- pvg 11y agoYou mean as syntax? Because the opcodes seem to be there.
- vardump 11y agoIsn't A the only register those ops can use anyways? Although it's been a while, 25 years...
- duskwuff 11y agoYou can't ASL X or Y, but you can ASL $0 or ASL $0, X. (Using either a zero-page address or an absolute address.)
- to3m 11y agoThis seems to be somewhat common - I've used a few assemblers that make you write ASL A as just ASL (and so on). Benefit (?): you can now have a label called "A".
- ddingus 11y agoThe accumulator is the only register those work with. It was very common to not specify it.at all. I actually never have in all the 6502 assembly code I've ever written. Wasn't required.
- pvg 11y agoI don't think that's true. http://www.downloads.reactivemicro.com/Public/Users/David_Craig/Apple2OriginalROMInfo.TXT http://www.downloads.reactivemicro.com/Public/Users/David_Cr... Code is straight from the Red Book listings. Search for ROR - accumulator (shown explicitly), indexed, you name it. 4 modes each.
- vardump 11y agoMemory operand is not a register operand. Unless you're one of those who consider 6502 zero page as 254 registers (IIRC, you couldn't use addresses 0 and 1, at least on C64, because they were used for ROM visibility and I/O control).
- ddingus 11y agoWell, I have written a lot of code on 6502. What you name is the value to be operated on, and that is indexed, zpage, immediate, etc... the accumulator is not named. There are two or three bytes, one instruction, one or two for value or address. Same for things like ADC, the accumulator is where it will happen, the things you name are values and addresses. LSL, LSR can just be stated, one byte instructions that operate on the accumulator, which does not need to be specified. 6502 is really basic. The accumulator is the working register for many things. The index registers are for indexing. One does not do LDX $c000, A for example.
- pvg 11y agoI believe you. But it was, quite typically, like you can see in the Woz code above. Or from '6502 Assembly Language Subroutines', 1982 vintage. http://i.imgur.com/jreIWA5.png http://i.imgur.com/jreIWA5.png
- ddingus 11y agoYeah, it can be. No worries. Guess I never assembled on something that required it. Fun old times in any case. That chip provided just enough, and no more.