phase 2, add/sub instructions work with +- operator

This commit is contained in:
Torsten Ruger
2014-05-20 11:54:59 +03:00
parent c3c6928dc8
commit c7a2ce5af9
3 changed files with 23 additions and 8 deletions

View File

@ -13,15 +13,13 @@ class TestSmallProg < MiniTest::Test
end
def test_loop
start = Vm::Block.new("start")
s = Vm::Block.new("start").scope binding
m = @program.main.scope binding
r0 = Vm::Integer.new(0)
m.r0 = 5 #1
m << start
start.instance_eval do
sub :r0, :r0, 1 , :update_status => 1 #2
bne start #3
end
m << s
s.r0 = r0 - 1 #2
s.bne s #3
@should = [0,176,160,227,5,0,160,227,1,0,80,226,253,255,255,26,1,112,160,227,0,0,0,239]
write "loop"
end