labels dont need to have l_ as prefix anymore
parent
0989bd54f0
commit
0c2217168d
10
assembler.rb
10
assembler.rb
|
@ -39,6 +39,10 @@ class Assembler
|
|||
def initialize(base, size)
|
||||
@base_addr = base
|
||||
@file_size = size
|
||||
|
||||
@first_pass = true
|
||||
@labels = {}
|
||||
@bytes = []
|
||||
end
|
||||
|
||||
def inspect
|
||||
|
@ -55,9 +59,9 @@ class Assembler
|
|||
|
||||
def method_missing(m, *args, &block)
|
||||
return 0 if @first_pass
|
||||
if m.to_s[0, 2] == "l_" then
|
||||
return @labels[m.to_s[2..]] if @labels.member?(m.to_s[2..])
|
||||
raise "label doesn't exist #{m.to_s}"
|
||||
if @labels.member?(m.to_s) then # if m.to_s[0, 2] == "l_" then
|
||||
return @labels[m.to_s] #return @labels[m.to_s[2..]] if @labels.member?(m.to_s[2..])
|
||||
#raise "label doesn't exist #{m.to_s}"
|
||||
else
|
||||
super
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue