Class: AArch64::Instructions::STRH_imm

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

Overview

STRH (immediate) – A64 Store Register Halfword (immediate) STRH <Wt>, [<Xn|SP>], #<simm> STRH <Wt>, [<Xn|SP>, #<simm>]! STRH <Wt>, [<Xn|SP>#<pimm>]

Instance Method Summary collapse

Constructor Details

#initialize(rt, rn, imm9, opt) ⇒ STRH_imm

Returns a new instance of STRH_imm.



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

def initialize rt, rn, imm9, opt
  @rt   = check_mask(rt, 0x1f)
  @rn   = check_mask(rn, 0x1f)
  @imm9 = check_mask(imm9, 0x1ff)
  @opt  = check_mask(opt, 0x03)
end

Instance Method Details

#encode(_) ⇒ Object



16
17
18
# File 'lib/aarch64/instructions/strh_imm.rb', line 16

def encode _
  STRH_imm(@imm9, @opt, @rn, @rt)
end