From 08390663c2c7e81f1e8e746482bf92082d0bbd2c Mon Sep 17 00:00:00 2001 From: pjht Date: Thu, 20 Oct 2016 13:18:20 -0500 Subject: [PATCH] stuff --- KT8/KT8 opcodes v3-.txt | 61 +++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/KT8/KT8 opcodes v3-.txt b/KT8/KT8 opcodes v3-.txt index 76d9211..407e135 100644 --- a/KT8/KT8 opcodes v3-.txt +++ b/KT8/KT8 opcodes v3-.txt @@ -1,6 +1,3 @@ -Proposed Op codes for KT8 processor -Created - CAK 2-11-2014 - KT8 (Krauter/Terpstra 8-bit) is a super simple processor that works with just 8-bit instructions. KT8 Has: @@ -9,44 +6,36 @@ KT8 Has: A = input 1 B = input 2 R = result -- 14 bytes of RAM memory[0-13]. -- A keyboard at address 14 -- A screen at address 15 - +- 32 bytes of RAM memory[0-31]. Some of these memory locations could do special things. Op Codes: Bits OP Name Description -0000 aaaa - LOADA aaaa : copy from RAM address to register A -0001 aaaa - LOADB aaaa : copy from RAM address to register B -0010 aaaa - SAVE aaaa : copy from register R to RAM address +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 -0011 xxxx - LOWBITS xxxx : B = 0000xxxx -0100 0000 - ADD : R = A + B -0100 0001 - SUB : R = A - B -0100 0010 - AND : R = A AND B -0100 0011 - OR : R = A OR B -0100 0100 - XOR : R = A XOR B -0100 0101 - INVA : R = bit inverse A -0100 0110 - INVB : R = bit inverse B -0100 0111 - PASSA : R = A -0100 1000 - PASSB : R = B -0100 1001 - LSHIFT : R = A << 1 -0100 1010 - RSHIFT : R = A >> 1 -0100 1011 - CLEAR : R = 0 -0100 1100 - INC : R = A + 1 -0100 1101 - DEC : R = A - 1 -0101 xxxx - FJMP xxxx : move program counter forward by xxxx instructions -0110 xxxx - BJMP xxxx : move program counter back by xxxx instructions +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 -0111 xxxx - FJMPZ : if R is zero move program counter forward by xxxx instructions -1000 xxxx - BJMPZ : if R is not zero move program counter forward by xxxx instructions +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 -1001 xxxx - FJMPNZ : if R is zero move program counter forward by xxxx instructions -1010 xxxx - BJMPNZ : if R is not zero move program counter forward by xxxx instructions - -1011 0000 - RESET : R = 0 -1011 0001 - HALT : stop KT8 - -1100 0000 - RKD : clear keyboard/display. \ No newline at end of file +1111 0000 - RESET : put program counter back to zero.