SPANKy ISA

SPANKy!


Brought to you by group GAMMA:
Victoria Smith (vics@rice.edu)
Mara Prandi-Abrams (mabrams@rice.edu)
Dennis Geels (geels@rice.edu)

Overview - Functional Specifications - ISA - Controller - Design and Layout - Performance Analysis - Summary

423 Final Report


ISA

A SPANKy opcode consumes the first four bits of each opcode. The bit encoding and semantics of the instructions follow.
The next four bits denote the destination register, which is also a source operand in any I-FORM or store instruction (excluding HALT).
The second byte either denotes two source registers or contains a single eight-bit immediate value, depending on the instruction format.
Here are the two formats, with labelled bit ranges:

BITS 0-34-7 8-1112-15
S-FORMOPRDRXRY
I-FORMOPRDIMM

Here are SPANKy's instructions, with opcode bit encoding, assembly mnemonic, and semantics (in C-like syntax):

BITSMNEMONICFORMSEMANTICS
0000ANDSRD = RX & RY
0001ANDiIRD &= IMM
0010ORSRD = RX | RY
0011ORiIRD |= IMM
0100NOTSRD = !RX
0101NOTiIRD = !IMM
0110ROTLSRD = RY << RX
0111ROTLiIRD <<= IMM
1000ADDSRD = RX + RY
1001ADDiIRD += IMM
1010LDSRD = MEM(RX)
1011LDiIRD = MEM(IMM)
1100STSMEM(RX) = RD
1101STiIMEM(IMM) = RD
1110BZIPC = IMM if (RD == 0)
1111HALTISPANKy stops.

SPANKy also provides a few useful pseudo-ops for your chewing enjoyment:

PSEUDO-OPIMPLEMENTATION
NOPAND R0,R0,R0
CLR RXANDi RX,0
MOV RD,RSOR RD,RS,RS
SET RX,IMMCLR RX
ORi RX,IMM
SUB RD,RX,RYNOT RY,RY
ADDi RY,1
ADD RD,RX,RY