Class: AArch64::Instructions::MOVK

Inherits:
Instruction show all
Defined in:
lib/aarch64/instructions/movk.rb

Overview

MOVK – A64 Move wide with keep MOVK <Wd>, #<imm>LSL #<shift> MOVK <Xd>, #<imm>LSL #<shift>

Instance Method Summary collapse

Constructor Details

#initialize(reg, imm, shift, sf) ⇒ MOVK

Returns a new instance of MOVK.



8
9
10
11
12
13
# File 'lib/aarch64/instructions/movk.rb', line 8

def initialize reg, imm, shift, sf
  @reg   = check_mask(reg, 0x1f)
  @imm   = check_mask(imm, 0xffff)
  @shift = check_mask(shift, 0x03)
  @sf    = check_mask(sf, 0x01)
end

Instance Method Details

#encode(_) ⇒ Object



15
16
17
# File 'lib/aarch64/instructions/movk.rb', line 15

def encode _
  MOVK(@sf, @shift, @imm, @reg)
end