Class: SCASM::Immediate
Instance Method Summary collapse
- #assemble ⇒ Object
-
#initialize(imm) ⇒ Immediate
constructor
A new instance of Immediate.
- #to_s ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(imm) ⇒ Immediate
Returns a new instance of Immediate.
134 135 136 |
# File 'lib/scasm/value.rb', line 134 def initialize imm @imm = imm end |
Instance Method Details
#assemble ⇒ Object
138 139 140 141 142 143 144 |
# File 'lib/scasm/value.rb', line 138 def assemble if @imm <= 0x1f return 0x20 + @imm else return 0x1f, @imm end end |
#to_s ⇒ Object
146 147 148 |
# File 'lib/scasm/value.rb', line 146 def to_s "imm(#@imm)" end |
#value ⇒ Object
150 151 152 |
# File 'lib/scasm/value.rb', line 150 def value @imm end |