tisc

tiny instruction set computer
Log | Files | Refs | README

INSTRUCTION_SET (2743B)


      1 TISCv2.3 (c) Paul Longtine <paul@nanner.co>
      2 Tiny Instruction Set Computer
      3 
      4  __________   ___      ________       ________
      5 |\___   ___\ |\  \    |\   ____\     |\   ____\
      6 \|___ \  \_| \ \  \   \ \  \___|_    \ \  \___|
      7      \ \  \   \ \  \   \ \_____  \    \ \  \
      8       \ \  \   \ \  \   \|____|\  \    \ \  \____
      9        \ \__\   \ \__\    ____\_\  \    \ \_______\
     10         \|__|    \|__|   |\_________\    \|_______| v2.3
     11                          \|_________|
     12 
     13 -----------------------------------------------------------------------<--------
     14 RAW      - memonic - description
     15 -----------------------------------------------------------------------<--------
     16 00000000 - SOP_ADD    ----- SetOp ADD, flag if overflow
     17 00010000 - SOP_SUB    ----- SetOp SUB, A-B and flag if sign is positive
     18 00100000 - SOP_AND    ----- SetOp AND, A&B and flag if the output is nonzero
     19 00110000 - SOP_XOR    ----- SetOp XOR, A^B and flag if the output is nonzero
     20 01000000 - SOP_XNOR   ----- SetOp XNOR, ~(A^B) and flag if the output is nonzero
     21 01010000 - SOP_CIN    ----- SetOp CIN, CMP will A+B+1 and flag if overflow
     22 01100000 - SOP_LSH    ----- SetOp LSH, lshift A by B bits, flag if overflow
     23 01110000 - SOP_RSH    ----- SetOp RSH, rshift A by B bits, flag if underflow 
     24 10010000 - GOTO       ----- Branches unconditionally to address stored in GRA
     25 10100000 - PCR        ----- Push program counter return address to stack
     26 11110000 - PTRINC     ----- Increment pointer by 1
     27 C B A 00 - OR         ----- C = A | B
     28 C B A 01 - NAND       ----- C = A nand B
     29 C B A 10 - OP         ----- C = A (OP) B - perform operation set by SOP_*
     30 C B 0010 - CIN        ----- C = ++B
     31 00<lo>11 - LLI        ----- Load lower immediate to GRA
     32 01000011 - LI         ----- Load byte immediate to GRA
     33 01<nb>11 - LNI        ----- Load <nb> length immediate to stack
     34 10000011 - JMP        ----- JMP to address in next program word if flag is false
     35 10010011 - PSH        ----- Push GRA to stack
     36 10100011 - POP        ----- Pop stack to reg GRA
     37 10110011 - PEEK       ----- Peek stack to reg GRA
     38 10000111 - LBS        ----- Load word from mem pointer to stack
     39 10B 0111 - LB         ----- Load word from mem pointer to ARGB GPR
     40 10001011 - SBS        ----- Pop stack and store to mem pointer
     41 10B 1011 - SB         ----- Store contents of ARGB GPR to mem pointer
     42 10001111 - SPS        ----- Pop stack and set mem pointer
     43 10B 1111 - SP         ----- Set pointer ARGB GPR
     44 11B A 11 - CMP        ----- Computes flag on set operation
     45 
     46 -----------------------------------------------------------------------<--------
     47 C = Arguement C / ARGC
     48 B = Arguement B / ARGB
     49 A = Arguement A / ARGA
     50 
     51 GRA = General Purpose Register A = 0b01
     52 GRB = General Purpose Register B = 0b10
     53 GRC = General Purpose Register C = 0b11
     54