Class: SCASM::ImmediateLabel

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



156
157
158
# File 'lib/scasm/value.rb', line 156

def name
  @name
end

Instance Method Details

#assembleObject



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_sObject



173
174
175
# File 'lib/scasm/value.rb', line 173

def to_s
  "l(#{@name.inspect})"
end