The Pico-Code is the blueprint for the GC's hardware. Even though each of the 16 possible microcode instructions theoretically takes the same amount of time (one clock-tick), it conceptually executes a unique block of pico-code. The pico-code hardware consists of an (almost) infinitely long tape of ones and zeros, plus a set of 16 registers and a 16-bit program counter (PC). Each register is 65,536 bits long. Register 0 is the accumulator (ACC). Register 1 is the data register (DAT). All pico-code instructions are stored in a buffer of size 32 KB. Each pico-code instruction is a multiple of 4 bits long. See Appendix A for the contents of the pico-code buffer.
Pico-Code Instructions
|
Name |
Op Code |
Length |
Description |
|
DTX |
0000 |
20 |
DAT = X; X is a signed 16-bit value |
|
DTA |
0001 |
20 |
DAT = 2 raised to the X-th power; X is a 16-bit value |
|
DSH |
0010 |
4 |
DAT = DAT >> 1 |
|
ACD |
0011 |
4 |
ACC = ACC + DAT |
|
ACZ |
0100 |
4 |
ACC = 0 |
|
MOV |
1000 |
12 |
REG X = REG Y; X,Y are 4-bit values |
|
JMP |
1001 |
20 |
PC = X; X is a 16-bit value |
|
BRZ |
1010 |
20 |
PC = X (if ACC = 0) |
|
BRN |
1011 |
20 |
PC = X (if ACC < 0) |
|
JIN |
1100 |
8 |
PC = REG Y; Y is a 4-bit value |
|
TRD |
1101 |
8 |
DAT[0] = Tape[REG Y] (read a bit from the tape) |
|
TWR |
1110 |
8 |
Tape[REG Y] = DAT[0] (write a bit to the tape) |
|
RET |
1111 |
4 |
Return or Halt |