On 28.12.2017 05:35, Randy Dawson via cctalk wrote:
What about the coding tools? ADASM? Looks long
gone, how
do you do microcode today?
Oh, I first started out with an assembler macro hack, but it
was insanely cumbersome, due to the limits of the macro
capability of the Z-80 assembler I was using.
I then wrote a micro-assembler in Pascal. It was better,
but still pretty cumbersome. There's a good chance that if
I actually had gotten to writing the full 360 microcode I
would have come up with improvements.
Here's a little test program for the old asm macro-based
assembler:
;DIM LIGHT PROG FOR MICRO ASSEMBLER
MACLIB UASM
INIT
; DEFINE 2 CONSTANTS IN SCRATCH PAD
SPONE DEFCON 1
SP4096 DEFCON 4096
; END OF CONSTANTS
DIM REGS GPR0,GPR0,GPR0 ;CLEAR GPR0
FUNC ZERO
CTRL CONT
GEN
REGS ACONST,GPR1,GPR1 ;COPY SPONE TO GPR1
DEST PASSWRT
FUNC APLUSCY
CONST SPONE
CTRL CONT
GEN
REGS ACONST,GPR3,GPR3 ;COPY SP4096 TO GPR3
DEST PASSWRT
FUNC APLUSCY
CONST SP4096
CTRL CONT
GEN
BIGLP REGS GPR0,GPR0,GPR0 ;INC GPR0, MOVE TO
COUNTER
DEST PASSWRT
FUNC APLUSCY
CY ONE
CTRL LDRCONT
NA 0,I ;CBUS => CTR
GEN
HILOOP REGS GPR2,GPR2,GPR2 ;ALL ONES TO CBUS
DEST PASSWRT
FUNC ALLONE
CTRL REPLNA
NA HILOOP
The GEN command generates one micro-instruction word from
all the keywords above it.
Here's what my 2nd gen Pascal micro-assembler code looked like :
CODE
; TITLE muldiv
;This program does multiply and divide on 2903/2904 32 bit CPU
; UNSIGNED MULTIPLY 32 X 32 => 64
; CLEAR R0 FOR MS PRODUCT
; MULTIPLICAND IN R1, MULTIPLIER IN R2
; PRODUCT IN R0 (MS) AND R1 (LS)
ORG 0
UMULT R=GPR0,GPR0,GPR0,F=ZERO,D=W ;CLEAR GPR0
R=GPR2,GPR2,GPR2,D=LDQ&W,F=A+CY,Q=LDRCONT,N=31 ;mOVE
MPLIER TO Q REG
;#MPLY CYCLES -1 => CTR
UMLP R=GPR1,GPR0,GPR0,D=MPYUSG,F=SPEC,Q=REPLNA,N=UMLP
;***** SHFT USGMPY
R=GPR1,GPR1,GPR1,F=Q+CY,D=W ;COPY LS PROD IN Q TO R1
UWAIT D=PASS,F=ZERO,Q=JUMP,N=UWAIT ;hang for user
to check result
; END OF UNSIGNED MULTIPLY
;
;
; SIGNED MULTIPLY 32 X 32 => 64
; CLEAR R0 FOR MS PRODUCT
; MULTIPLICAND IN R1, MULTIPLIER IN R2
; PRODUCT IN R0 (MS) AND R1 (LS)
SMULT r=GPR0,GPR0,GPR0,F=ZERO,D=W ;CLEAR GPR0
r=GPR2,GPR2,GPR2,D=LDQ&W,F=A+CY,Q=LDRCONT,N=30 ;mOVE
MPLIER TO Q REG
;#MPLY CYCLES -2 => CTR
SMLP r=GPR1,GPR0,GPR0,D=MPY2CM,F=SPEC,Q=REPLNA,N=SMLP ;2S
COMPL MPY
;***** SHFT MPY2CM
r=GPR1,GPR0,GPR0,D=MPY2LST,F=SPEC ;2S COMPL MPY LAST
CYCLE
r=GPR1,GPR1,GPR1,F=Q+CY,D=W ;COPY LS PROD IN Q TO R1
SWAIT D=PASS,F=ZERO,Q=JUMP,N=SWAIT ;hang for user
to check result
; END OF UNSIGNED MULTIPLY
END
This tests the multiply functions on the 2903. The tab
formatting got messed up pasting this here,
it looked better in the original form.
Jon