A simulated CISC
machine written in PASCAL
for the purpose of teaching the basics of assembly language
. The assembler for the CUSP assembly language is called CHASM
. Instead of creating byte code
it returns a human readable file containing the hexadecimal
equivalent of the instructions in your source file, which can then be loaded into CUSP and run altogether, or single stepped through to see the effect of each instruction on all the registers and memory locations.
CUSP uses 24 bit memory words, and 12 bit memory addresses, a 24 bit accumulator
and instruction register
, a 12 bit program counter
, index register
, stack pointer
, and frame pointer
CUSP instructions consist of an 8 bit opcode
, a 4 bit addressing mode
, and a 12 bit operand
Example: $042001 is the instruction to store the contents of the accumulator in memory location $001.
Here's some sample code in assembler mnemonics
That code snippet loads the accumulator with the value stored at memory location $E00, adds 1 to it, then stores it back in the same place.