Class: AArch64::Instructions::SUB_addsub_imm

Inherits:
Instruction
  • Object
show all
Defined in:
lib/aarch64/instructions/sub_addsub_imm.rb

Overview

SUB (immediate) – A64 Subtract (immediate) SUB <Wd|WSP>, <Wn|WSP>, #<imm><shift> SUB <Xd|SP>, <Xn|SP>, #<imm><shift>

Instance Method Summary collapse

Constructor Details

#initialize(rd, rn, imm, shift, sf) ⇒ SUB_addsub_imm

Returns a new instance of SUB_addsub_imm.



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

def initialize rd, rn, imm, shift, sf
  @rd    = check_mask(rd, 0x1f)
  @rn    = check_mask(rn, 0x1f)
  @imm   = check_mask(imm, 0xfff)
  @shift = check_mask(shift, 0x01)
  @sf    = check_mask(sf, 0x01)
end

Instance Method Details

#encode(_) ⇒ Object



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

def encode _
  SUB_addsub_imm(@sf, @shift, @imm, @rn, @rd)
end