From 527e591e75f31de032895d1888e7bc6427edc01b Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Mon, 29 Sep 2014 21:04:38 +0300 Subject: [PATCH] fix add instruction and test --- lib/arm/logic_instruction.rb | 2 +- test/arm/test_add.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/arm/logic_instruction.rb b/lib/arm/logic_instruction.rb index 7abf6632..a80b4bdb 100644 --- a/lib/arm/logic_instruction.rb +++ b/lib/arm/logic_instruction.rb @@ -31,7 +31,7 @@ module Arm right = Virtual::IntegerConstant.new( right ) end if (right.is_a?(Virtual::IntegerConstant)) - if true #TODO (right.fits_u8?) + if (right.fits_u8?) # no shifting needed operand = right.integer immediate = 1 diff --git a/test/arm/test_add.rb b/test/arm/test_add.rb index da3e8900..8321176a 100644 --- a/test/arm/test_add.rb +++ b/test/arm/test_add.rb @@ -25,6 +25,6 @@ class TestAdd < MiniTest::Test end def test_big_add code = @machine.add :r1 , :r1, 0x220 - assert_code code , :add , [0x20,0x12,0x81,0xe2] #e2 81 12 20 e28110dc + assert_code code , :add , [0x22,0x1e,0x81,0xe2] #e2 81 1e 22 end end \ No newline at end of file