Test-Word
Information
Test-Word can be used on a VIP with printer output and a keyboard as input.
V0-F are stored on memory locations 0FD0.
Definitions
| aaa | 12 bit address |
| kk | 8 bit constant |
| x | Register number Vx (x = 0 to F) |
| y | Register number Vy (y = 0 to F) |
| [aaa] | Memory value of address aaa |
| . | Not used, value doesn't matter |
| 1..9, A..F | Hexadecimal digits |
Syntax
| Opcode | Mnemonic | Parameter | Definition |
|---|---|---|---|
| 7xkk | ADD | Vx, kk | Vx = Vx + kk |
| 8xy4 | ADD | Vx, Vy | Vx = Vx + Vy, V0 is carry / not borrow |
| 8xy2 | AND | Vx, Vy | Vx = Vx AND Vy |
| 2aaa | CALL | aaa | Call subroutine at aaa. The subroutine must end in 00A7 (which is the 'Test-Word' equivalent of RETURN) |
| Bx.. | INP | WORD | Input word (ASCII text until space / 0x20) from keyboard and store at address with high byte from 300+Vx and low byte from 380+Vx |
| 1aaa | JP | aaa | Jump to address aaa |
| Aaaa | LD | RA, aaa A, aaa |
RA = aaa |
| 6xkk | LD | Vk, kk | Vx = kk |
| 8xy0 | LD | Vy, Vx | Vy = Vx |
| Fx00 | LD | [RA], Vx [A], Vx |
[RA] = Vx, RA = RA + 1 |
| Fxkk | LD | [RA], kk [A], kk |
[RA] = kk, RA = RA + 1 |
| 8xy1 | OR | Vx, Vy | Vx = Vx OR Vy |
| D.kk | kk | Send byte kk to the printer | |
| Dx00 | WORD | Print word (ASCII text until space / 0x20) from address with high byte from 300+Vx and low byte from 380+Vx | |
| Eaaa | WORDS | Print words from pointers stored at address aaa, stopping at code 0xff. Words (ASCII text until space / 0x20) are stored at address with high byte from 300+pointer and low byte from 380+pointer | |
| 00A7 | RETURN | Return from subroutine | |
| Cxkk | RND | Vx, kk | Vx = random AND kk |
| 8xy6 | SHR | Vx, Vy | Vx = Vy SHR, V0 is carry / not borrow |
| 3xkk | SE | Vx, kk | Skip next instruction if Vx = kk |
| 5xy. | SE | Vx, Vy | Skip next instruction if Vx = Vy |
| 4xkk | SNE | Vx, kk | Skip next instruction if Vx != kk |
| 9xy. | SNE | Vx, Vy | Skip next instruction if Vx != Vy |
| 8xy5 | SUB | Vx, Vy | Vx = Vx - Vy, V0 is carry / not borrow |
| 8xy7 | SUBN | Vx, Vy | Vx = Vy - Vx, V0 is carry / not borrow |
| 0aaa | SYS | aaa | Call CDP1801 code at aaa. The subroutine must end in a RET (D4) |
| 8xy3 | XOR | Vx, Vy | Vx = Vx XOR Vy |