fix arm tests

This commit is contained in:
Torsten Ruger
2015-05-29 12:47:49 +03:00
parent 73e5ec550a
commit 3e9e650764
7 changed files with 37 additions and 31 deletions

View File

@ -23,7 +23,7 @@ class TestMoves < MiniTest::Test
code = @machine.mov :r0, 0x222 # is not 8 bit and can't be rotated by the arm system in one instruction
code.set_position(0)
begin # mov 512(0x200) = e3 a0 0c 02 add 34(0x22) = e2 80 00 22
assert_code code , :mov , [ 0x02,0x0c,0xa0,0xe3 , 0x22,0x00,0x80,0xe2]
assert_code code , :mov , [ 0x02,0x0c,0xa0,0xe3 , 0x22,0x00,0x80,0xe2]
rescue Register::LinkException
retry
end
@ -33,7 +33,7 @@ class TestMoves < MiniTest::Test
assert_code code , :mvn , [0x05,0x10,0xe0,0xe3] #e3 e0 10 05
end
def test_constant_small # like test_mov
const = Virtual::ObjectConstant.new
const = Virtual.new_word "harvey"
const.set_position( 13 ) # 13 = 5 + 8 , 8 for the arm pipeline offset, gets subtracted
code = @machine.mov :r1 , 5
code.set_position(0)
@ -41,12 +41,12 @@ class TestMoves < MiniTest::Test
assert_code code , :mov , [0x05,0x10,0xa0,0xe3] #e3 ef 10 05
end
def test_constant_big # like test_mov_big
const = Virtual::ObjectConstant.new
const = Virtual.new_word "harvey"
const.set_position( 0x222 )
code = @machine.mov :r0 , 0x222
code = @machine.mov :r0 , 0x222
code.set_position(0)
begin # mov 512(0x200) = e3 a0 0c 02 add 34(0x22) = e2 80 00 22
assert_code code , :mov , [ 0x02,0x0c,0xa0,0xe3 , 0x22,0x00,0x80,0xe2]
assert_code code , :mov , [ 0x02,0x0c,0xa0,0xe3 , 0x22,0x00,0x80,0xe2]
rescue Register::LinkException
retry
end