Pseudo CARDTRAN command syntax described here is likely the first ever pseudo language developed for an 1802 like system. It runs on a FRED1 which uses the SYSTEM 00 prototype CPU which is a simplified 1801.
TV Display is divided in 3 areas, TV(0) and TV(1) which can be used by the CARDTRAN program and TV(2) which is used by the interpreter:
TV(0) TV(1) TV(2)
This program (included in the cardtran.bin file) will wait for two four digit numbers, when the numbers are given it will multiply them and show a counter counting up to the result. At the end it will wait for two new numbers. If no input is given I think some random numbers are chosen.
This info is also available online on the Emma 02 site.
aa | 2 digits hexadecimal value. This is used to indicate an address in hexadecimal range of 0200-02C7. Note that the original CARDTRAN code uses a 2 digit decimal value to indicate a decimal 'line' number referring to the 0200-02C7 address range by multiplying the value aa with 2 and adding hexadecimal value of 200 |
DR | 4 digits decimal register for use in CARDTRAN program. Value is stored on address 02E0/02E1. |
. | Not used, value doesn't matter |
1..9 | Decimal digits |
40aa | ADD | [2aa], DR 2aa, DR |
M[2aa] + DR -> M[2aa], 000C -> DR |
70aa | DISP0 | [2aa] 2aa |
Display word on M[2aa] on TV(0) display position |
71aa | DISP1 | [2aa] 2aa |
Display word on M[2aa] on TV(1) display position |
10aa | INPUT | [2aa] 2aa |
Wait for 4 digit word input and store word -> M[2aa] |
22aa | JNZ | 2aa DR, 2aa |
Jump to 2aa if DR != 0 |
20aa | JP | 2aa | JumP to 2aa |
21aa | JZ | 2aa DR, 2aa |
Jump to 2aa if DR = 0 |
60aa | LD | [2aa], DR 2aa, DR |
DR -> M[2aa] |
30aa | LD | DR, [2aa] DR, 2aa |
M[2aa] -> DR |
90aa | LDD | [2aa], DR 2aa, DR |
LSD of DR -> LSD of M[2aa] |
0... | SKIP | Skip | |
50aa | SUB | [2aa], DR 2aa, DR |
M[2aa] - DR -> M[2aa], 000B -> DR |
80aa | RSH | [2aa] 2aa |
Ring SHift M[2aa] right 1 digit |