Page 104 - ARM 64 Bit Assembly Language
P. 104
90 Chapter 4
4.2.2.3
1 ands x0, x1, #7 // x0 = x1 & 0x111 and set PSTATE
2
3 bic x3, x3, x4, lsl #5 // x3 = x3 & ~(x4 << 5)
4
5 eor x4, x5, #0x3fffc000 // x4 = x5 ^ 0x3fffc000
4.2.3 Data movement operations
The data movement operations copy data from one register to another:
mov Move,
movz Move wide with zero,
movn Move wide with NOT, and
movk Move wide with keep.
The mov instruction is an alias, chosen by the assembler, for orr, movz, movn,or add in-
structions. It facilitates choosing an immediate value or moving a register value to or from
the stack pointer. The wide moves allow the programmer to widen the sixteen bit immediate
value to fill a 32 or 64 bit destination register.
4.2.3.1 Syntax
mov Rd|SP, Rn|SP
mov Rd, #<imm16>|#<pattern>
<op> Rd, #<imm16>{, lsl #<shift>}
• <op> is one of the wide moves movz, movn,or movk. It accepts an optional <shift> of
either 0, 16, 32, or 48 for a 64-bit destination registers, or a shift of 0 or 16 for 32-bit des-
tination registers.
• Non-pattern immediates are wide (16-bits long).
• Any 64-bit value can be loaded with 4 movk instructions. If it is a pattern, it can be done
with just one mov instruction, which is an alias for orr.
4.2.3.2 Operations
Name Effect Description
mov Rd|sp ← Rd|sp Move general purpose register to or
from the sp or to or from another gen-
eral purpose register.
continued on next page