Assembly movsbq instruction

259 Views Asked by At

I understood the difference between movz and movs. movz fills the empty bytes with zeros while movs fills them with sign bit (zeros or ones).

However, I came accross the following example

  1. movabsq $0x0011223344556677, %rax
  2. movb $0xAA, %dl
  3. movb %dl, %al
  4. movsbq %dl, %rax

After line 3, %rax = 00112233445566AA. I undertood untill this. But I could not get why %rax is equal to FFFFFFFFFFFFFFAA after line 4. Shouldn't it be 00000000000000AA because empty bits are filled with zero as %dl is positive ?

0

There are 0 best solutions below