A few answers:
jbanes, on Wed Apr 5, 2006 10:27 AM, said:
2. There seems to be some confusion on how (indirect),y memory addressing works. To verify, the indirect address is an 8 bit value that points to a 16 bit, little-endian address in the zero page of memory. That 16 bit address is then added to Y to produce the final address. Correct?
(
indirect),Y addressing works like this:
indirect is an 8-bit zero-page byte which contains the low byte of a 16-bit address. The high byte is found at
indirect+1.
So, if $90 = $00, $91 = $F0, and Y = 7 then
lda ($90),Y
Will load the accumulator with the value found at $F007 ($F000 + 7).
That make sense?
Also: I don't think any of the indexed zero-page opcodes handle
zero-page page-crossing; I think if
$FF = $00, $100 = $F0, $00 = $E0, and Y = 3, then
lda ($FF),Y
Will load the accumulator with the value found at address $E003,
not $F003!
Quote
Many opcodes take an extra cycle if the page boundary is crossed. However, none of the documentation seems to suggest which page we're working in relation to. Absolute addressing is particularly confusing, as it's in relation to nothing.
It is always the target (16-bit) address.
Examples ($80=$FF, $81=$F8 ,Y=1, X=1)
lda $F1FF,Y ;page crossed is $F100 -> $F200
lda $FF,X ;no penalty! page-crossing not handled in ZP,X opcodes
lda ($80),Y ;page crossed is $F800 -> $F900
That make sense?
Quote
PHP and PLP can be used to get and retrieve a byte representation of the processor's internal flags. Does anyone know which order these are in? I've been assuming the following, but I haven't found any docs that confirm it:
7 6 5 4 3 2 1 0
x N V B D I Z C
That is incorrect; the unused bit is bit 5, I think. Look here:
http://www.geocities...s/asm1step.html
bit -> 7 0
+---+---+---+---+---+---+---+---+
| N | V | | B | D | I | Z | C | <-- flag, 0/1 = reset/set
+---+---+---+---+---+---+---+---+
Incidentally, that document (and this:
http://www.6502.org/...02opcodes.html) are probably sufficient to answer all your 6502 assembly questions.