1

I'm reading through the part about how jump instructions are encoded and I am confused about the highlighted line of text: See text here.

How is 0xf3 = decimal -13? Is this an error? I tried checking the errata but nothing there either.

here's the assembly

CubeJockey
  • 2,209
  • 8
  • 24
  • 31
Faheem
  • 1,423
  • 2
  • 13
  • 22

1 Answers1

1

No, it's not an error. "Single-byte, two's complement" is the important part here. So:

  • 0xf3 in base 10 is (15 * 16) + (3 * 1) = 240 + 3 = 243
  • 243 in binary is 11110011
  • Using two's complement form to get the "actual" number in base 10:

11110011

= -128 + 64 + 32 + 16 + 0 * 8 + 0 * 4 + 2 + 1

= -128 + 64 + 32 + 16 + 2 + 1

= -13

Michael Rawson
  • 1,905
  • 1
  • 15
  • 25