6502 Data Bus: Signed or Unsigned? That is the question...

For discussing the 65xx hardware itself or electronics projects.
Post Reply
andrewem
Posts: 17
Joined: 21 May 2004
Location: Burlington, ON

6502 Data Bus: Signed or Unsigned? That is the question...

Post by andrewem »

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?

:oops:
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Post by GARTHWILSON »

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.
Post Reply