found and fixed a real bug
This commit is contained in:
parent
4fa00371e5
commit
529f109171
@ -22,7 +22,7 @@ module Asm
|
|||||||
if (opcode =~ /(#{COND_POSTFIXES})$/)
|
if (opcode =~ /(#{COND_POSTFIXES})$/)
|
||||||
@cond = $1.to_sym
|
@cond = $1.to_sym
|
||||||
opcode = opcode[0..-3]
|
opcode = opcode[0..-3]
|
||||||
end
|
end unless opcode == 'teq'
|
||||||
if (opcode =~ /s$/)
|
if (opcode =~ /s$/)
|
||||||
@s = true
|
@s = true
|
||||||
opcode = opcode[0..-2]
|
opcode = opcode[0..-2]
|
||||||
|
@ -77,6 +77,10 @@ class TestArmAsm < MiniTest::Test
|
|||||||
code = @generator.instance_eval { swi 0x05 }.first
|
code = @generator.instance_eval { swi 0x05 }.first
|
||||||
assert_code code , :swi , [0x05,0x00,0x00,0xef]#ef 00 00 05
|
assert_code code , :swi , [0x05,0x00,0x00,0xef]#ef 00 00 05
|
||||||
end
|
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
|
def test_mov
|
||||||
code = @generator.instance_eval { mov r0, 5 }.first
|
code = @generator.instance_eval { mov r0, 5 }.first
|
||||||
assert_code code , :mov , [0x05,0x00,0xa0,0xe3] #e3 a0 10 05
|
assert_code code , :mov , [0x05,0x00,0xa0,0xe3] #e3 a0 10 05
|
||||||
|
Loading…
Reference in New Issue
Block a user