found and fixed a real bug

This commit is contained in:
Torsten Ruger 2014-04-18 16:04:14 +03:00
parent 4fa00371e5
commit 529f109171
2 changed files with 5 additions and 1 deletions

View File

@ -22,7 +22,7 @@ module Asm
if (opcode =~ /(#{COND_POSTFIXES})$/)
@cond = $1.to_sym
opcode = opcode[0..-3]
end
end unless opcode == 'teq'
if (opcode =~ /s$/)
@s = true
opcode = opcode[0..-2]

View File

@ -77,6 +77,10 @@ class TestArmAsm < MiniTest::Test
code = @generator.instance_eval { swi 0x05 }.first
assert_code code , :swi , [0x05,0x00,0x00,0xef]#ef 00 00 05
end
def test_teq
code = @generator.teq( [:reg , 'r1'] , [:reg , 'r2'] ).first
assert_code code , :teq , [0x02,0x00,0x31,0xe1] #e1 31 00 02
end
def test_mov
code = @generator.instance_eval { mov r0, 5 }.first
assert_code code , :mov , [0x05,0x00,0xa0,0xe3] #e3 a0 10 05