Class: AArch64::Instructions::TBZ

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

Overview

TBZ – A64 Test bit and Branch if Zero TBZ <R><t>, #<imm>, <label>

Instance Method Summary collapse

Constructor Details

#initialize(rt, imm, label, sf) ⇒ TBZ

Returns a new instance of TBZ.



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

def initialize rt, imm, label, sf
  @rt    = check_mask(rt, 0x1f)
  @imm   = check_mask(imm, 0x1f)
  @label = label
  @sf    = check_mask(sf, 0x1)
end

Instance Method Details

#encode(pos) ⇒ Object



14
15
16
# File 'lib/aarch64/instructions/tbz.rb', line 14

def encode pos
  TBZ(@sf, @imm, check_mask(unwrap_label(@label, pos), 0x3fff), @rt)
end