diff --git a/lib/asm/arm/instruction.rb b/lib/asm/arm/instruction.rb index 2d7536c8..e5242a7d 100644 --- a/lib/asm/arm/instruction.rb +++ b/lib/asm/arm/instruction.rb @@ -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] diff --git a/test/test_crystal.rb b/test/test_crystal.rb index 9320b556..b6568994 100644 --- a/test/test_crystal.rb +++ b/test/test_crystal.rb @@ -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