where did jump flags go?

master
Reese 2 years ago
parent c4d413e475
commit 736f2e2f0b

@ -2,30 +2,53 @@ RGPC2 technical information document
also known as the ramblings of a madman with not enough coffee
16 bits wide
X RAM
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 OUTR AREG BREG JFLG JREG
XXXX;XXXX;XXXX;XXXX;XXXX;XXXX;
IMMEDIATE
;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 8Bit
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
Instruction set:
If Y = 1 invert ALU output
OR = Y001
ADD = Y010
SUB = Y011
AND = Y100
XOR = Y101
LDI = Y110
JMP = Y111
If Y = 1 invert ALU output
OR = Y001
ADD = Y010
SUB = Y011
AND = Y100
XOR = Y101
LDI = Y110
JMP = Y111
Psuedo instructions:
MOV = OR {Destination} {Source} ZERO
HLT = (
LDI 1 > G1
SUB G1 PGCR > G2
JMP G2
)

@ -0,0 +1,11 @@
MOV 1 G1
MOV 1 G2
MOV 4 G4
MOV 10000 G5
ADD G1 G2 > G3
MOV G1 G2
MOV G3 G1
MOV G1 OUTP
SUB G5 G1 > G6
JLZ G6 G4
Loading…
Cancel
Save