Class: AArch64::Instructions::ADRP

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

Overview

ADRP – A64 Form PC-relative address to 4KB page ADRP <Xd>, <label>

Instance Method Summary collapse

Constructor Details

#initialize(xd, label) ⇒ ADRP

Returns a new instance of ADRP.



7
8
9
10
# File 'lib/aarch64/instructions/adrp.rb', line 7

def initialize xd, label
  @xd    = check_mask(xd, 0x1f)
  @label = label
end

Instance Method Details

#encode(_) ⇒ Object



12
13
14
15
# File 'lib/aarch64/instructions/adrp.rb', line 12

def encode _
  label = unwrap_label(@label, 0) / 4096
  ADRP(label & 0x3, check_mask(label >> 2, 0x7ffff), @xd)
end