View Single Post
Old 19th November 2013, 01:40 AM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236

I don't care.
Bit 0 is not neutral.
It's a part of a byte, equally as much as every other bit.

Bits in a byte are numbered 0 to 7, not 1 to 10 or whatever.
So the correct answer was 104, not 52.

Originally Posted by retroben View Post
I forgot to realize that 80 in hex can be positive when used
in half words (2 byte length).
Halfwords are only 2 bytes on CPUs like MIPS.
A halfword can easily be 1 single byte on systems you haven't hacked for yet.
A halfword may also be 4 bytes or more for other systems.

To specify a negative hex, you use the negative sign, just as you would in decimal.

-0x80 is -128; +0x80 is +128.
Most often, a single byte in computer science is interpreted as "unsigned"; meaning it's 0:255, not -128:+127.

0xFFFF could be either +65535 or -1 if the 16-bit number is signed.
It depends which N64 CPU instructions buffer the number from RDRAM and how the programmer chooses to read it.

There is no universal rule of thumb that 0x8000:0xFFFF in 2 byte is ALWAYS a negative number, etc.
Reply With Quote