compile tools to s-code

you can generate s-code from n-code, hence every tools (nut.txt, gen2.txt) can be compiled into s-code which can be executed by s-code VM (somv2).

However, those tools require some system call which are specific to nut:

sys 3	tokenise
sys 9	get heapFree
sys 10	print readable n-code
sys 11	read stdin into inbuf[]
sys 12	print source line number

If these calls are implemented in somv2 then all tools can be compiled into s-code which run under somv2.  

example

c:>nut32<nut.txt
c:>copy a.obj nut.obj
c:>nsim32<gen2.txt>gen2.obj
edit gen2.obj to delete prolog
c:>copy gen2.obj a.obj
c:>nsim32<nut.obj>nuts.obj
c:>nsim32<gen2.obj>gen2s.obj

now all tools are in s-code, you can use "somv2" to execute s-code.  To compile:

c:>somv2 -x nuts.obj < source > n-object

to generate s-code:

c:>somv2 -x gen2s.obj < n-object > s-object

and to run it:

c:>somv2 -x s-object

3 July 2006

