Class: SCASM::Immediate

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

Instance Method Summary collapse

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

#assembleObject



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_sObject



146
147
148
# File 'lib/scasm/value.rb', line 146

def to_s
  "imm(#@imm)"
end

#valueObject



150
151
152
# File 'lib/scasm/value.rb', line 150

def value
  @imm
end