Class: AArch64::Instructions::SUB_addsub_shift

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

Overview

SUB (shifted register) – A64 Subtract (shifted register) SUB <Wd>, <Wn>, <Wm><shift> #<amount> SUB <Xd>, <Xn>, <Xm><shift> #<amount>

Instance Method Summary collapse

Constructor Details

#initialize(rd, rn, rm, shift, amount, sf) ⇒ SUB_addsub_shift

Returns a new instance of SUB_addsub_shift.



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

def initialize rd, rn, rm, shift, amount, sf
  @rd     = check_mask(rd, 0x1f)
  @rn     = check_mask(rn, 0x1f)
  @rm     = check_mask(rm, 0x1f)
  @shift  = check_mask(shift, 0x03)
  @amount = check_mask(amount, 0x3f)
  @sf     = check_mask(sf, 0x01)
end

Instance Method Details

#encode(_) ⇒ Object



17
18
19
# File 'lib/aarch64/instructions/sub_addsub_shift.rb', line 17

def encode _
  SUB_addsub_shift(@sf, @shift, @rm, @amount, @rn, @rd)
end