CARDIAC Instruction Set
CARDIAC (CARDboard Illustrative Aid to Computation) is a learning aid developed for Bell Telephone Laboratories in 1968 to teach high school students how computers work. The computer operates in base 10 and has 100 memory cells which can hold signed numbers from 0 to 999. It has an instruction set of 10 instructions which allows CARDIAC to add, subtract, test, shift, input, output and jump.
Opcode | Instruction | Description |
---|---|---|
INP | Input | take a number from the input card and put it in a specified memory cell. |
CLA | Clear and add | clear the accumulator and add the contents of a memory cell to the accumulator. |
ADD | Add | add the contents of a memory cell to the accumulator. |
TAC | Test accumulator contents | performs a sign test on the contents of the accumulator; if minus, jump to a specified memory cell. |
SFT | Shift | shifts the accumulator x places left, then y places right, where x is the upper address digit and y is the lower. |
OUT | Output | take a number from the specified memory cell and write it on the output card. |
STO | Store | copy the contents of the accumulator into a specified memory cell. |
SUB | Subtract | subtract the contents of a specified memory cell from the accumulator. |
JMP | Jump | jump to a specified memory cell. The current cell number is written in cell 99. This allows for one level of subroutines by having the return be the instruction at cell 99 (which had '8' hardcoded as the first digit. |
HRS | Halt and reset | move bug to the specified cell, then stop program execution. |