You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.4 KiB

RGPC2 technical information document
also known as the ramblings of a madman with not enough coffee
16 bits wide
Instruction format:
1:
OPCO OUTR AREG BREG JFLG JREG
XXXX;XXXX;XXXX;XXXX;XXXX;XXXX;
2:
OPCO OUTR IMMEDIATE
XXXX;XXXX;XXXX:XXXX:XXXX:XXXX;
OPCO = Opcode
OUTR = Output Register
AREG = A Register
BREG = B Register
JFLG = Jump Flags
JREG = Jump Register
If running LDI use 2
Registers:
ZERO = 0000 R 16Bit
G1 = 0001 R/W 16Bit
G2 = 0010 R/W 16Bit
G3 = 0011 R/W 16Bit
G4 = 0100 R/W 16Bit
OUTP = 0101 W 16Bit
PGCR = 0110 R 8 Bit
G5 = 0111 R/W 16Bit
G6 = 1000 R/W 16Bit
GPIO1 = 1001 R/W 16Bit
GPIO2 = 1010 R/W 16Bit
GPIO3 = 1011 R/W 16Bit
GPIO4 = 1100 R/W 16Bit
G7 = 1101 R/W 16Bit (RGPC2-S Only)
G8 = 1110 R/W 16Bit (RGPC2-S Only)
RAND = 1111 R 16Bit (RGPC2-S Only)
Instruction set:
If Y = 1 invert ALU output
OR = Y001
ADD = Y010
SUB = Y011
AND = Y100
XOR = Y101
LDI = Y110
JMP = Y111
Jump flags:
XXX1 = Greater than zero
XX1X = Less than zero
X1XX = Zero
1XXX = Not zero
Pseudo instructions:
MOV = OR {Destination} {Source} ZERO
HLT = (
MOV PGCR G1
JMP G1
)
JGZ = JMP JFLG:0001
JLZ = JMP JFLG:0010
JIZ = JMP JFLG:0100
JNZ = JMP JFLG:1000
JMP = JMP JFLG:1111