better logic with new block class

This commit is contained in:
Torsten Ruger
2014-04-25 18:37:19 +03:00
parent 7af46d210b
commit 92beb638de
9 changed files with 189 additions and 137 deletions

View File

@@ -1,3 +1,5 @@
require_relative "instruction"
module Asm
# There are only three call instructions in arm branch (b), call (bl) and syscall (swi)
@@ -17,7 +19,7 @@ module Asm
case opcode
when :b, :bl
arg = args[0]
if arg.is_a? Label
if arg.is_a? Block
diff = arg.position - self.position - 8
arg = NumLiteral.new(diff)
end