Class: SCASM::OffsetRegisterMemory
Instance Method Summary collapse
- #assemble ⇒ Object
-
#initialize(regsym, imm) ⇒ OffsetRegisterMemory
constructor
A new instance of OffsetRegisterMemory.
- #to_s ⇒ Object
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
#assemble ⇒ Object
50 51 52 |
# File 'lib/scasm/value.rb', line 50 def assemble return (0x10 + REGISTERS[@regsym]), @imm end |
#to_s ⇒ Object
54 55 56 |
# File 'lib/scasm/value.rb', line 54 def to_s "iregmem(#@regsym, #@imm)" end |