use factory to generte intergers in space

start with just integer factory in space
change all the hand-out code
still #14
This commit is contained in:
Torsten Ruger
2018-08-24 18:49:21 +03:00
parent d396da16e3
commit 71ab369c71
16 changed files with 59 additions and 61 deletions

View File

@ -35,11 +35,11 @@ module Risc
def test_load_space
load_ins = main_ticks 53
assert_load load_ins, Parfait::Space
assert_load load_ins, Parfait::Factory
end
def test_load_to
to = main_ticks 54
assert_slot_to_reg to , :r5 , 5 ,:r2
assert_slot_to_reg to , :r5 , 2 ,:r2
end
def test_load_25
load_ins = main_ticks 9

View File

@ -45,7 +45,7 @@ module Risc
ret = main_ticks(64)
assert_equal FunctionReturn , ret.class
assert_equal :r1 , ret.register.symbol
assert_equal 27080 , @interpreter.get_register(ret.register)
assert_equal 41992 , @interpreter.get_register(ret.register)
end
end
end

View File

@ -68,11 +68,11 @@ module Risc
end
def test_load_int_space
cons = main_ticks(base + 6)
assert_load( cons , Parfait::Space , :r3)
assert_load( cons , Parfait::Factory , :r3)
end
def test_load_int_next_space
sl = main_ticks(base + 7)
assert_slot_to_reg( sl , :r3 , 5 , :r2)
assert_slot_to_reg( sl , :r3 , 2 , :r2)
assert_equal Parfait::Integer , @interpreter.get_register(:r2).class
end
def test_load_int_next_int
@ -82,7 +82,7 @@ module Risc
end
def test_load_int_next_int2
sl = main_ticks(base + 9)
assert_reg_to_slot( sl , :r4 , :r3 , 5)
assert_reg_to_slot( sl , :r4 , :r3 , 2)
end
end
end