phase 1- get rid of the pesty args in structions

This commit is contained in:
Torsten Ruger
2014-05-10 15:47:27 +03:00
parent 3f88fe15b4
commit 8faf0ba17f
8 changed files with 20 additions and 25 deletions

View File

@@ -27,14 +27,13 @@ module Arm
@update_status_flag = 0
@condition_code = :al
@opcode = attributes[:opcode]
@args = [attributes[:left] , attributes[:right] , attributes[:extra]]
@operand = 0
end
def assemble(io)
case @opcode
when :b, :bl
arg = @args[0]
arg = @attributes[:left]
#puts "BLAB #{arg.inspect}"
if( arg.is_a? Fixnum ) #HACK to not have to change the code just now
arg = Arm::NumLiteral.new( arg )
@@ -54,7 +53,7 @@ module Arm
end
io.write_uint8 OPCODES[opcode] | (COND_CODES[@condition_code] << 4)
when :swi
arg = @args[0]
arg = @attributes[:left]
if( arg.is_a? Fixnum ) #HACK to not have to change the code just now
arg = Arm::NumLiteral.new( arg )
end