|
Cardiac
Documentation
|
|
Technical Specifications
Cardiac has 100 memory locations, each capable of holding a three digit
decimal number with a sign. This is about 1KB. It has a single accumulator register which is capable of
addition and subtraction, but don't expect too much. The other
registers are:
- MAR - Memory Address Register - used to control which cell of
memory is fetched or stored
- MDR - Memory Data Register - used as to hold data read from or
being written to memory
- PC - Program Counter - the address of the next instruction to
execute
- INST - Instruction Register - holds the instruction being executed
Entering A Program
You enter a program by typing it into the memory cells. Click with your
mouse and try it.
Running a Program
Set the PC to the start address and:
- Run - to execute rather rapidly, perhaps 1Hz
- Step - to execute a single instruction
- Slow - to execute the program slowly so you can watch each dinky
data transfer tediously be performed and animated (you can set the
speed if you want)
- Stop - to make sure the thing stops
Saving and Loading Programs
The obvious menu commands sort of work on memory images.
The Editor and Assembler
Lame, isn't that what Jennifer
Garner wears in Alias? There is actually a
lame little editor and
assembler you can get at from the file menu. You can edit, load and
save a text file and then assemble and run it using the Run button. The
syntax is wretched, but familiar:
label: opcode target
The label is optional, but must have a colon after it if present.
Comments start with a //
There is a data pseudo-op for initializing data.
The target must be a number or a known label. There is no fancy shmancy
parser.
The opcodes are hlt, lac, add, tst, shf, out, sto, sub, jmp and inp.
The shift opcode just takes a two digit number. See the instruction
crib sheet on the main window for the order of the digits.