0

I have 2 examples given: Example 1: enter image description here

I understand that EAX stores 00 00 00 2A becasue 02Ah is 42d in hex.

And here is the second example: enter image description here

Can anyone explain why there is ?? ?? FF FE and what is has to do with -2 ?

Thank you

fuz
  • 88,405
  • 25
  • 200
  • 352
  • 5
    Read up on two's complement representation. – fuz Oct 24 '21 at 12:38
  • 2
    The reason for the `??` is b/c the `mov bx,-2` does not modify the upper 16-bits of `ebx`. -2 in 16-bits is `FFFE`, so in little endian memory, `FE FF`. We cannot index registers so despite the overlapping nature of `bl` & `bh`, with `bx` & `ebx`, there is no issue or question of endian until a multi-byte value is written to memory (as memory, being indexable, does have endian-ness as a property). – Erik Eidt Oct 24 '21 at 20:14

0 Answers0