Rz version 3.5
It has a new syntax, using indentation instead of { } and newline instead of ;
Here is an example of the new form:
fac(n)
if( n == 0 ) return 1
else return n * fac(n-1)
main()
print(fac(10))
It also recognises "syscall". It can compile "syscall" although not
being a reserved word. The compiler takes "hint" from the source, by
defining an empty function:
syscall()
when the compiler encounter "syscall" it can convert that into (parse
tree):
syscall(14,n) => (call
syscall 14 #1)
and generate code => get.1
sys.14
syscall is used as an escape hatch to add extra code to the virtual
machine.
Including in the package is the virtual machine som v2 x (special) that
can execute the output object code of rz35.
Som v2 x syscall
1) syscall(1,a) print a as integer
2) syscall(2,c) print c as character
(ascii)
3) x = syscall(3) getchar()
4) syscall(4,s) gets() get string to s
5) -
6) syscall(6,s) print string s
7) syscall(7) stop
13) syscall(13) stop (compatible with
higher version)
last update 26 Sept 2011