How to use nut compiler and n-sim to run n-code


the compiler "nut" takes the source program written in nut language from standard input and produces an object file (machine code) as "a.obj".

c:> nut < program

to run this program, n-machine simulator (nsim) takes an n-code object file and execute it.  nsim produces output on the screen.

c:> nsim < a.obj

Many useful functions are defined in "lib.txt" which should be concatenated to the source file and compiled.

c:> type lib.txt program | nut

Two simple batch files are prepared for your use.

cp  = "type lib.txt %1 | nut"
run = "nsim < a.obj"

to compile  c:> cp source
to run      c:> run

24 November 2004
P. Chongstitvatana