Initially, I thought it was unsigned (please... don't ask why), but now I'm pretty sure it's signed because of something I noticed with the Relative addressing mode and how can it be both right?
6502 Data Bus: Signed or Unsigned? That is the question...
6502 Data Bus: Signed or Unsigned? That is the question...
This may sound like a really stupid question to diehard hardware buffs: is the Data Bus in the 6502 signed? or unsigned?
Initially, I thought it was unsigned (please... don't ask why), but now I'm pretty sure it's signed because of something I noticed with the Relative addressing mode and how can it be both right?

Initially, I thought it was unsigned (please... don't ask why), but now I'm pretty sure it's signed because of something I noticed with the Relative addressing mode and how can it be both right?
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Whether it's signed or not is mostly a matter of how the data are interpreted.
Relative addressing is indeed signed so that you can branch half a page in either direction, regardless of where you are relative to an actual page boundary.
In the case of indexing, the only time it goes backwards is if there's a wraparound at the end of zero page or at the end of memory. Otherwise indexing always goes forward only-- no negative numbers there.
In arithmetic, it can be signed or unsigned. The processor doesn't have to know which way you intend it, because it's all a matter of how you interpret the results.
Relative addressing is indeed signed so that you can branch half a page in either direction, regardless of where you are relative to an actual page boundary.
In the case of indexing, the only time it goes backwards is if there's a wraparound at the end of zero page or at the end of memory. Otherwise indexing always goes forward only-- no negative numbers there.
In arithmetic, it can be signed or unsigned. The processor doesn't have to know which way you intend it, because it's all a matter of how you interpret the results.