Class: SCASM::OffsetRegisterMemory

Inherits:
Value
  • Object
show all
Defined in:
lib/scasm/value.rb

Instance Method Summary collapse

Constructor Details

#initialize(regsym, imm) ⇒ OffsetRegisterMemory

Returns a new instance of OffsetRegisterMemory.



44
45
46
47
48
# File 'lib/scasm/value.rb', line 44

def initialize regsym, imm
  fail "invalid register #{regsym.inspect}" unless REGISTERS.member? regsym
  @regsym = regsym
  @imm = imm
end

Instance Method Details

#assembleObject



50
51
52
# File 'lib/scasm/value.rb', line 50

def assemble
  return (0x10 + REGISTERS[@regsym]), @imm
end

#to_sObject



54
55
56
# File 'lib/scasm/value.rb', line 54

def to_s
  "iregmem(#@regsym, #@imm)"
end