Index Absoulte X

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Index Absoulte X
by on (#42416)
Hello, I'm implementing Indexed Abolute X for LDA... And im not sure whether I should treat X as a signed or unsigned byte (because it gets added or subtracted to LDA). What do I treat X and the accumulator as? Signed or Unsigned?

by on (#42417)
When indexing it's always unsigned because you always load data that is (at most) 255 bytes after the argument.
The exeption is for zero page indexed instruction where it warps arround inside zero page, you could consider the index is somewhat signed but that's not what actually happens.

But when you do instruction such as ldx or tax, you have to set the "negative" flag too even if it's "ungisned".