Class: SCASM::ImmediateLabel
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #assemble ⇒ Object
-
#initialize(name) ⇒ ImmediateLabel
constructor
A new instance of ImmediateLabel.
- #resolve(imm) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ ImmediateLabel
Returns a new instance of ImmediateLabel.
158 159 160 161 |
# File 'lib/scasm/value.rb', line 158 def initialize name @name = name @imm = nil end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
156 157 158 |
# File 'lib/scasm/value.rb', line 156 def name @name end |
Instance Method Details
#assemble ⇒ Object
168 169 170 171 |
# File 'lib/scasm/value.rb', line 168 def assemble #fail unless @imm return 0x1f, (@imm||0) # HACK end |
#resolve(imm) ⇒ Object
163 164 165 166 |
# File 'lib/scasm/value.rb', line 163 def resolve imm fail if @imm @imm = imm end |
#to_s ⇒ Object
173 174 175 |
# File 'lib/scasm/value.rb', line 173 def to_s "l(#{@name.inspect})" end |