Difference between revisions of "Signed"
From Sonic Retro
(1-byte signed ints turn negative at 0x80, not 0x81) |
m (Negatives do start at $80, but $80 equals -$80, not -$7F.) |
||
Line 1: | Line 1: | ||
[[Category: Hacking Information]] | [[Category: Hacking Information]] | ||
− | When using the signed hexadecimal number system in programming (such as [[68000]] assembly), the values '''$80''' to '''$FF''' are interpreted as '''-$ | + | When using the signed hexadecimal number system in programming (such as [[68000]] assembly), the values '''$80''' to '''$FF''' are interpreted as '''-$80''' to '''-$01''' respectively. This is simpler than actually prefixing a number with the minus symbol "-". |
Conversely, the '''unsigned''' number system has no negatives. So '''$81''' is read simply as '''$81'''. | Conversely, the '''unsigned''' number system has no negatives. So '''$81''' is read simply as '''$81'''. |
Revision as of 11:01, 13 October 2004
When using the signed hexadecimal number system in programming (such as 68000 assembly), the values $80 to $FF are interpreted as -$80 to -$01 respectively. This is simpler than actually prefixing a number with the minus symbol "-".
Conversely, the unsigned number system has no negatives. So $81 is read simply as $81.