Class: SCASM::RegisterMemory
Instance Method Summary collapse
- #assemble ⇒ Object
-
#initialize(regsym) ⇒ RegisterMemory
constructor
A new instance of RegisterMemory.
- #to_s ⇒ Object
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
#assemble ⇒ Object
34 35 36 |
# File 'lib/scasm/value.rb', line 34 def assemble return 0x08 + REGISTERS[@regsym] end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/scasm/value.rb', line 38 def to_s "regmem(#@regsym)" end |