labels dont need to have l_ as prefix anymore

master
bx 2021-09-05 22:35:50 +01:00
parent 0989bd54f0
commit 0c2217168d
1 changed files with 7 additions and 3 deletions

View File

@ -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