42 lines
1.6 KiB
Plaintext
42 lines
1.6 KiB
Plaintext
KT8 (Krauter/Terpstra 8-bit) is a super simple processor that works with just 8-bit instructions.
|
|
|
|
KT8 Has:
|
|
- 8-bit wide instructions in a separate bank of program memory.
|
|
- Three registers for arithmetic:
|
|
A = input 1
|
|
B = input 2
|
|
R = result
|
|
- 32 bytes of RAM memory[0-31]. Some of these memory locations could do special things.
|
|
|
|
Op Codes:
|
|
|
|
Bits OP Name Description
|
|
|
|
000 aaaaa - LOADA aaaaa : copy from RAM address to register A
|
|
001 aaaaa - LOADB aaaaa : copy from RAM address to register B
|
|
010 aaaaa - SAVE aaaaa : copy from register R to RAM address
|
|
|
|
0110 xxxx - LOWBITS xxxx : save 4bits=xxxx to low bits[0-3] of B
|
|
0111 xxxx - HIGHBITS xxxx : save 4bits=xxxx to high bits[7-4] of B
|
|
1000 0000 - ADD : R = A + B
|
|
1000 0001 - SUB : R = A - B
|
|
1000 0010 - AND : R = A AND B
|
|
1000 0011 - OR : R = A OR B
|
|
1000 0100 - XOR : R = A XOR B
|
|
1000 0101 - INVA : R = bit inverse A
|
|
1000 0110 - INVB : R = bit inverse B
|
|
1000 0111 - SWAPA : swap values between R and A
|
|
1000 1000 - SWAPB : swap values between R and B
|
|
1000 1001 - LSHIFT : shift bits in R to the left
|
|
1000 1010 - RSHIFT : shift bits in R to the right
|
|
1000 1011 - CLEAR : set R to zero
|
|
1000 1100 - INC : add 1 to R
|
|
1000 1101 - DEC : subtract 1 from R
|
|
|
|
1100 xxxx - FJMP xxxx : move program counter forward by xxxx instructions
|
|
1101 xxxx - BJMP xxxx : move program counter back by xxxx instructions
|
|
1110 0000 - SKIPZ : if R is zero move program counter forward 2 instead of 1
|
|
1110 0001 - SKIPNZ : if R is not zero move program counter forward 2 instead of 1
|
|
|
|
1111 0000 - RESET : put program counter back to zero.
|