How to use S2 microprogramming system


The package contains the following

directories:

as2    -- source assembler for S2
doc    -- various documents
example    -- all example program and executable
mpgm    -- source microprogram generator
s2micro    -- source s2 simulator with micropgm

Go to example.  Several programs are already assembled.

example

call.txt  -- show a call
fac.txt   -- recursive call
for.txt   -- for loop
loop2.txt -- loop
while.txt -- while loop
list.txt  -- search list
listm.txt -- search list with extended instruction

to assemble an assembly program:

E:example>as2 fac.txt

as2 produces fac.lis (the listing for human for aided debugging), fac.obj (the object code).

to run the program in the S2 simulator:

E:example>s2m fac.obj

E:example>s2m fac.obj
load program, last address 24
>g
83 instructions, 350 clocks, CPI 4.22
>o
24
>q

E:example>

The simulator required the following files: mpgm.txt (the bit microprogram file), mspec.h (the signal definition file).  

To generate the bit microprogram file, the source microprogram is compiled by:

E:example>mgen > mpgm.txt

mgen produces the bit file to the standard output, and the "mspec.h" file.  When you make a change to the source microprogram you have to regenerate the bit file.  Do not edit the signal definition section as it will corrupt the simulator.  If
you want to add any new signal you have to also change the simulator source itself and recompile the simulator.

last update 15 Feb 2005