1
mov x0, #1000

mov w6, #-1
add x7,x0,x6, sxtw

what will be the value of x6 and x7? [In hex] Here ans x6=0xffffffff //why all value of lower half filled with 1? and how sxtw work when the ans will be 999 in decimal. I want to know details how this happening.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847

1 Answers1

0
// 1= 000000000000000000000001 (On 32bit)
// -1= 111111111111111111111111
// So -1 in hex = 0xffffffff

The lower half of x6 will be filled with above value.

On 3rd statement it sign extends the value to 64bit so -1 is correct then it add 1000+(-1) and become value 999