removed the (too) fancy dsl. Also introduce register indirection
This commit is contained in:
@ -16,8 +16,8 @@ def fibonaccit(n) # n == r0
|
||||
end #r5 <- r0 - 1 n=n-1 through r5 tmp
|
||||
return b
|
||||
end # r0 <- r5
|
||||
|
||||
putint(fibonaccit( 10 ))
|
||||
fibo = fibonaccit( 10 )
|
||||
fibo.putint()
|
||||
HERE
|
||||
@should = [0x0,0x40,0x2d,0xe9,0x0,0x20,0xa0,0xe3,0x1,0x30,0xa0,0xe3,0x1,0x0,0x51,0xe3,0x6,0x0,0x0,0xda,0x2,0x40,0xa0,0xe1,0x3,0x20,0xa0,0xe1,0x3,0x50,0x84,0xe0,0x5,0x30,0xa0,0xe1,0x1,0x60,0x41,0xe2,0x6,0x10,0xa0,0xe1,0xf6,0xff,0xff,0xea,0x3,0x70,0xa0,0xe1,0x0,0x80,0xbd,0xe8,0x0,0x40,0x2d,0xe9,0x0,0x20,0xa0,0xe3,0x1,0x30,0xa0,0xe3,0x1,0x0,0x51,0xe3,0x6,0x0,0x0,0xda,0x2,0x40,0xa0,0xe1,0x3,0x20,0xa0,0xe1,0x3,0x50,0x84,0xe0,0x5,0x30,0xa0,0xe1,0x1,0x60,0x41,0xe2,0x6,0x10,0xa0,0xe1,0xf6,0xff,0xff,0xea,0x3,0x70,0xa0,0xe1,0x0,0x80,0xbd,0xe8]
|
||||
@output = " 55 "
|
||||
@ -31,8 +31,8 @@ HERE
|
||||
def test_kernel_fibo
|
||||
int = Vm::Integer.new(1)
|
||||
fibo = @object_space.get_or_create_class(:Object).get_or_create_function(:fibo)
|
||||
main = @object_space.main.scope binding
|
||||
main.int = 10
|
||||
main = @object_space.main
|
||||
main.mov int , 10
|
||||
ret = main.call( fibo )
|
||||
main.mov( :r1 , :r7 )
|
||||
putint = @object_space.get_or_create_class(:Object).get_or_create_function(:putint)
|
||||
|
Reference in New Issue
Block a user