Class: SCASM::RegisterMemory

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

Instance Method Summary collapse

Constructor Details

#initialize(regsym) ⇒ RegisterMemory

Returns a new instance of RegisterMemory.



29
30
31
32
# File 'lib/scasm/value.rb', line 29

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

Instance Method Details

#assembleObject



34
35
36
# File 'lib/scasm/value.rb', line 34

def assemble
  return 0x08 + REGISTERS[@regsym]
end

#to_sObject



38
39
40
# File 'lib/scasm/value.rb', line 38

def to_s
  "regmem(#@regsym)"
end