算术右移,结果带符号。
Arithmetic Shift Right (immediate) shifts a register value right by an immediate number of bits, shifting in copies of the sign bit in the upper bits and zeros in the lower bits, and writes the result to the destination register.
算术右移(立即)将寄存器值右移一个立即的位数,在高位中移动符号位的副本,在低位中移动零,并将结果写入目标寄存器。
32-bit variant
Applies when sf == 0 && N == 0 && imms == 011111.
ASR <Wd>, <Wn>, #<shift>
is equivalent to
SBFM <Wd>, <Wn>, #<shift>, #31
64-bit variant
Applies when sf == 1 && N == 1 && imms == 111111.
ASR <Xd>, <Xn>, #<shift>
is equivalent to
SBFM <Xd>, <Xn>, #<shift>, #63
mov x0, $0x1515 // 0x1515 = 1010100010101b
asr x0, x0, #1 // x0=0x1a8a
1 0101 0001 0101 = 0x1515
算术右移一位结果为 1 1010 1000 1010 = 0x1a8a