The original 6200 CPU architecture clearly was not microcoded given the cycle timing (and the fact that I had to use a 2x clock in order to use a microcode), but it makes the development much cleaner, so that is what I chose to do. The microcode ISA is actually quite simple, given that almost all of the instructions simply transfer data around the bus, which is strongly connected.
See Tools for information on the assembler.
Global things that are set in decode, instead of being in the microcode
- 1 bit for auto-increment PC
4 bits for ALU instruction
Other things
- Must be able to extract
r
andq
register immediates into actual A, B, MX, MY
NOP
- Does nothing for one microcode step
000_00000_00000_000
TRANSFER
- Transfers 4 bits from source to dest
- 5 bits for source
- 5 bits for dest
- 3 bits for post-increment specification
001_[source 12:8][dest 7:3][inc 2:0]
TRANSALU
- Always has ALU as source
1 bit for whether or not to transfer flags- 4 bits for ALU instruction
- 5 bits for dest
- 3 bits for post-increment specification
010_0[ALU 11:8][dest 7:3][inc 2:0]
SETPC
- Set 8 bits from immediate to
PCS
- Changes to PC are written on the fetch (first half) step, as to set PC before the next instruction is read
- Cancels PC increment
011_00000_00000_000
- Set 8 bits from immediate to
STARTINTERRUPT
TRANSFER PCP MSP_DEC INC(SP_DEC)
- Disable interrupt flag
011_10000_00000_000
SETPCVEC
- Set 12 bit "special" immediate (reset or interrupt vector) to
PC
- Changes to PC are written on the fetch (first half) step, as to set PC before the next instruction is read
- Cancels PC increment
011_10000_00000_000
- Set 12 bit "special" immediate (reset or interrupt vector) to
JMP
- 1 bit for conditional. If 1, following two bits are used
- 1 bit for flag. 0 for zero, 1 for carry
- 1 bit for set. 0 for unset, 1 for set
x
bits for jump address. If flag matches condition, jump to microaddress100_[conditional 12:12][flag 11:11][set 10:10][jump addr 9:0]
CALLEND
- Special instruction to transfer the low 4 bits of
PC+1
toM(SP - 1)
, while at the same time copying 8 bit immediate toPCS
- Optionally copies
NPP
toPCP
- Changes to PC are written on the fetch (first half) step, as to set PC before the next instruction is read
- Optionally copies
- Decrement SP
- 1 bit for
NPP
copy. If unset,PCP
is set to 0, otherwise it's set toNPP
101_00000_00000_00[NPP copy 0:0]
- Special instruction to transfer the low 4 bits of
CALLSTART
- Special instruction to transfer the mid or high 4 bits of
PC+1
toM(SP - 1)
- Decrement SP
- 1 bit for
PCP
vsPCSH
copy. If unset,PCSH
is copied, otherwisePCP
101_01000_00000_00[nibble select 0:0]
- Special instruction to transfer the mid or high 4 bits of
RETEND
- Special instruction to transfer
PCSH
andPCP
to M(SP + 1) faster than normal - Increments SP
- 1 bit to copy
PCP
. If unset,PCSH
is copied, andM(SP+1)
begins loading atWRITE
. If set,PCP
is copied, stored onWRITE
101_10000_00000_00[PCP copy 0:0]
- Special instruction to transfer
JPBAEND
- Special instruction to transfer
A
toPCSL
along with transferring theN*P
values - Changes to PC are written on the fetch (first half) step, as to set PC before the next instruction is read
110_00000_00000_000
- Special instruction to transfer
HALT
- Stops the CPU
- 1 bit to stop peripheral oscillator
111_00000_00000_00[stop oscilllator 0:0]