movz

Move Zero

MOVZ <Wd>, #<imm16> {, lsl #<shift>}

Moves 16-bit immediate to register, zeroing other bits.

Details

Moves a 16-bit immediate into Wd at the position specified by shift, zeroing all other 16-bit half-words. No condition flags are affected. This is an AArch64-only instruction commonly used as the first instruction when building large constants, often followed by MOVK instructions.

Pseudocode Operation

shift_amount ← hw × 16
Wd ← imm16 ≪ shift_amount

Example

MOVZ w0, #16

Encoding

Binary Layout
0
10
100101
hw
imm16
Rd
 
Format Data Processing
Opcode 0x52800000
Extension Base

Operands

  • Wd
    Destination 32-bit integer register
  • imm16
    Imm
  • shift
    Shift amount

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x52800000 MOVZ <Wd>, #<imm>{, LSL #<shift>} A64 0 | 10 | 100101 | hw | imm16 | Rd
0xD2800000 MOVZ <Xd>, #<imm>{, LSL #<shift>} A64 1 | 10 | 100101 | hw | imm16 | Rd

Description

Move wide with zero moves an optionally-shifted 16-bit immediate value to a register.

Operation

bits(datasize) result;

result = Zeros(datasize);

result<pos+15:pos> = imm16;
X[d, datasize] = result;