clean and work on labels

This commit is contained in:
Torsten Ruger
2014-04-21 17:27:05 +03:00
parent f0c0166d1f
commit ff38bde44e
7 changed files with 70 additions and 54 deletions

View File

@@ -17,7 +17,9 @@ module Asm
end
def add_relocation(*args)
@relocations << Asm::Relocation.new(*args)
reloc = Asm::Relocation.new(*args)
raise "reloc #{reloc.inspect}"
@relocations << reloc
end
def assemble(io)
@@ -27,6 +29,7 @@ module Asm
@relocations.delete_if do |reloc|
io.seek reloc.position
puts "reloc #{reloc.inspect}"
if (reloc.label.extern?)
reloc.handler.call(io, io.tell, reloc.type)
else