How to write a Simulator for SML code
i have written a SML code(below) which ask the user to input positive number and print out the total sum. the program will jump out of the input if user enter negative number. But don't really know how to write a simulator with C++ to test the code. hope somebody can help me with it.
Location Number
-------- ------
00 +1009 (10=read,09=location of A)
01 +2009 (20=load, 09=location of A)
02 +4108 (41=branch negative, 08=write to screen)
03 +2010 (20=load,10=location of B)
04 +3009 (30=add,09=location of A)
05 +2110 (21=store,10=location of B
06 +4000 (40=branch,00=read A)
07 +1110 (11=write,10=location of B)
08 +4300 (halt)
09 +0000 variable of a
10 +0000 variable of b
|