0

65535 = 0xffff(unsigned) -1 = 0xffff(signed) In my bochsgdb mov ax , 65535 and mov ax , -1 can change the content in AX to 11111111 I don't know why it has the same effect. If in this way . How does 8086 assembly distinguish between -1 and 65535 ? and How do I know the bits are represented for unsigned or signed ?

I thy to google but I did not get the answer , I wish you can explain why is this ? please

xhyf77
  • 1
  • 1
    It's all how you interpret the bits. Some operations treat the bits as unsigned, some as signed. For the case of setting a register there's really no practical difference. – Some programmer dude Jan 01 '23 at 07:37
  • 2
    "How do I know the bits are represented for unsigned or signed " -- the same way the processor knows: the program says so by the choice of instructions used, whenever it matters. – Erik Eidt Jan 01 '23 at 07:43
  • -1 and 65535 are the same number. Ever played blackjack? An ace can be a 1 or an 11 depending on what you want it to be at any given moment. It's like that. – puppydrum64 Jan 04 '23 at 12:30

0 Answers0