TITLE EXAMPLE DEFINITION FILE FOR THE AM2903/29203
;
;
WORD 	64
;
; AM2903 INSTRUCTION SET
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
; 
; ALU SOURCE OPERANDS (EA, I0, OEB)
; 16 REGISTER - TWO ADDRESS VERSION
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
;
RAMAB:	EQU	Q#0		; RAM A PORT, RAM B PORT
RAMADB:	EQU	Q#1		; RAM A PORT, DATA BUS B
RAMAQ:	EQU	Q#2		; OR Q#3 - RAM A PORT, Q REGISTER
DARAMB:	EQU	Q#4		; DATA BUS A, RAM B PORT
DADB:	EQU	Q#5		; DATA BUS A, DATA BUS B
DAQ:	EQU	Q#6		; OR Q#7 - DATA BUS A, Q REGISTER
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
;
; ALU FUNCTIONS - NORMAL MODE (I4, I3, I2, I1, I0 ALL NOT 0)
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
SPECL:	EQU	H#0		; I0 MUST BE LOW
HIGH:	EQU	H#0		; I0 MUST BE HIGH (Q REGISTER SELECT)
SUBR:	EQU	H#1		; F = S - R - 1 + Cin
SUBS:	EQU	H#2		; F = R - S - 1 + Cin
ADD:	EQU	H#3		; F = R + S + Cin
INCRS:	EQU	H#4		; F = S + Cin
INCSNON:EQU	H#5		; F = NOT S + Cin
INCRR:	EQU	H#6		; F = R + Cin
INCRNON:EQU	H#7		; F = NOT R + Cin
LOW:	EQU	H#8		; F = LOW
NOTRS:	EQU	H#9		; F = NOT R AND S
EXNOR:	EQU	H#A		; F = R EXNOR S
EXOR:	EQU	H#B		; F = R EXOR S
AND:	EQU	H#C		; F = R AND S
NOR:	EQU	H#D		; F = R NOR S
NAND:	EQU	H#E		; F = R NAND S
OR:	EQU	H#F		; F = R OR S
;
; * * * * * * * * * * * * * * * * * * * * * * *
;
; ALU DESTINATION CONTROL ( I8 - I7 - I6 - I5)
;     NORMAL FUNCTIONS
; * * * * * * * * * * * * * * * * * * * * * * *
;
;
RAMDA:	EQU	H#0		; F TO RAM, ARITHMETIC DOWN SHIFT
RAMDL:	EQU	H#1		; F TO RAM, LOGICAL DOWN SHIFT
RAMQDA:	EQU	H#2		; DOUBLE PRECISION ARITHMETIC DOWN SHIFT
RAMQDL: EQU     H#3		; DOUBLE PRECISION LOGICAL DOWN SHIFT
RAM:	EQU	H#4		; F TO RAM WITH PARITY
QD:	EQU	H#5		; F TO Y, DOWN SHIFT Q
LOADQ:	EQU	H#6		; F TO Q WITH PARITY
RAMQ:	EQU	H#7		; F TO RAM AND Q WITH PARITY
RAMUPA: EQU	H#8		; F TO RAM, ARITHMETIC UP SHIFT
RAMUPL: EQU	H#9		; F TO RAM, LOGICAL UP SHIFT
RAMQUPA:EQU	H#A		; DOUBLE PRECISION ARITHMETIC UP SHIFT
RAMQUPL:EQU	H#B		; DOUBLE PRECISION LOGICAL UP SHIFT
YBUS:	EQU	H#C		; F TO Y ONLY
QUP:	EQU	H#D		; F TO Y, UP SHIFT Q
SIGNEXT:EQU	H#E		; SIO0 TO Yi
RAMEXT: EQU	H#F		; F TO Y, SIGN EXTEND LEAST SIG. BYTE
;
; * * * * * * * * * * * * * * * ** * * * * * * * * * * * *
;
; SPECIAL FUNCTIONS (I8-I7-I6-I5)            
;
;
; Am2903 FUNCTIONS ONLY
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
MULT:	EQU	H#0		; UNSIGNED MULTIPLY
TWOMULT:EQU	H#2 		; TWO'S COMPLEMENT MULTIPLY
TWOLAST:EQU	H#6 		; TWO'S COMPLEMENT MULTIPLY LAST STEP
INCRMNT:EQU	H#4 		; INCREMENT BY 1 + Cin
SGNTWO:	EQU	H#5 		; SIGN MAGNITUDE-TWO'S COMPL CONVERTION
SLN:	EQU	H#8 		; SINGLE LENGTH NORMALIZE
DLN:	EQU	H#A 		; DOUBLE LENGTH NORMALIZE
DIVFRST:EQU	H#A 		; TWO'S COMPLEMENT DIVIDE FIRST STEP
DIVIDE: EQU	H#C 		; TWO'S COMPLEMENT DIVIDE MIDDLE STEPS
DIVLAST:EQU	H#E 		; TWO'S COMPLEMENT DIVIDE LAST STEP
;
;
;
; Am29203 ADDITIONS FORTHCOMING
;
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;  
;
; DEFINITION FILE FOR FIGURE 29, PAGE 2-57, 1980 DATA BOOK
;
; EXPANDED MEMORY FOR THE Am2903 USING THE Am20705
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
;
; ONLY THE SOURCE FIELDS CHANGE - EXPANDED
; A THIRD ADDRESS FIELD WAS ALSO ADDED (ADDRESS C)
;
;
;
; SOURCE OPERANDS
; ADDED A ADDRESS BITS (A6-A5-A4)
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
;
AINALU:	EQU	Q#0   		; A ADDRESSES 2903 REGISTERS
AIS7051:EQU	Q#1		; A ADDRESSES FIRST 29705 ADDITION
AIS7052:EQU	Q#2		; A ADDRESSES SECOND 29705 ADDITION
ACONST:	EQU	Q#3		; A ADDRESSES CONSTANT PROM
ABUS:	EQU	Q#4		; A FROM BUS
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
; ADDED B ADDRESS BITS (B5-B4)
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
;
;
BINALU:	EQU	B#00		; B ADDRESSES 2903 REGISTERS
BIS7051:EQU	B#01		; B ADDRESSES FIRST 29705 ADDTION
BIS7052:EQU	B#10		; B ADDRESSES SECOND 29705 ADDITION
BBUS:	EQU	B#11		; B FROM BUS
;
;
; * * * * * * * * * * * * * * * * * * * * * * * *
;
; THREE ADDRESS OPERATION - THIRD ADDRESS FIELD
; ADDED C ADDRESS BITS (C5-C4)
; * * * * * * * * * * * * * * * * * * * * * * * *
;
;
CIN2903:EQU	B#00		; C ADDRESSES 2903 REGISTERS
CIS7051:EQU	B#01		; C ADDRESSES FIRST 29705 ADDITION
CIS7052:EQU	B#10		; C ADDRESSES SECOND 29705 ADDITION
CBUS:	EQU	B#11		; C TO B BUS OUT
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
; I0 SOURCE SELECT FIELD REPLACES EA-I0-OEB THREE-BIT FIELD
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;  
QREGSEL:EQU	B#1		; SOURCE IS Q REGISTER
NONQREG:EQU	B#0		; SOURCE IS RAMB OR B.BUS
;
;
; * * * * * * * * * * * * * * * * * * * * * 
;
; MISCELLANEOUS FIELDS
;
; REGISTERS
; * * * * * * * * * * * * * * * * * * * * *
;
R0:		EQU	H#0
R1:		EQU	H#1
R2:		EQU	H#2
R3:		EQU	H#3
R4:		EQU	H#4
R5:		EQU	H#5
R6:		EQU	H#6
R7:		EQU	H#7
R8:		EQU	H#8
R9:		EQU	H#9
R10:		EQU	H#A
R11:		EQU	H#B
R12:		EQU	H#C
R13:		EQU	H#D
R14:		EQU	H#E
R15:		EQU	H#F
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * 
;
; CARRY BIT (2 BITS FOR NOW)
;
; * * * * * * * * * * * * * * * * * * * * * * * * * *
;
;
CARRY:		EQU	B#01 
NOCARRY:	EQU	B#00		;IMAGINATIVE!
IC:		EQU	B#10		; Cin is Cout
Z:		EQU	B#11		; Z is Cin
;
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
;
; Am2910 MICROPROGRAM CONTROLLER INSTRUCTION SET
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
;
JZ:		EQU	H#0		; RESET STACK, MICROPC, ADDRESS
CJS:		EQU	H#1		; COND JUMP SUBROUTINE, PUSH STACK
JMAP:		EQU	H#2		; UNCOND JUMP TO MEMORY MAP (Di)
CJP:		EQU	H#3		; COND JUMP PIPELINE 
PUSH:		EQU	H#4		; PUSH STACK, LOAD REG MAYBE, CONT
JSRP:		EQU	H#5		; JUMP SUB FROM REG (F) OR PIPE(T)
CJV:		EQU	H#6		; COND JUMP TO VECTOR INTER (Di)
JRP:		EQU	H#7		; JUMP TO REG (F) OR PIPE (T)
RFCT:		EQU	H#8		; DO LOOP REPEAT UNTIL CTR=0 - STACK
RPCT:		EQU	H#9		; DO LOOP UNTIL CTR=0 - PIPE
CRTN:		EQU	H#A		; COND RETURN, POP STACK (T)
CJPP:		EQU	H#B		; COND JUMP PIPELINE, POP STACK
LDCT:		EQU	H#C		; LOAD REGISTER, CONTINUE
LOOP:		EQU	H#D		; DO LOOP UNTIL TEST=T - STACK
CONT:		EQU	H#E		; CONTINUE
TWB:		EQU	H#F		; THREE WAY (DEAD MAN TIMER!)
;
;
; * * * * * * * * * * * * * * * * * * * * * * * * * *
;
; Am2904 SHIFT INSTRUCTIONS (I9-I8-I7-I6 AND SE)
;    I10 IS TIED TO I8 OF Am2903/29203
;
; * * * * * * * * * * * * * * * * * * * * * * * * * *
;
;
; DOWN SHIFTING
;
SDZRZQ:		EQU	H#0		; Z->RN; Z->QN
SDOROQ:		EQU	H#1		; 1->RN; 1->QN
SLN.RECOVER:    EQU	H#2		; 0->RN; R0->Mc; MN->QN
DDOR:		EQU	H#3		; 1->RN; R0->QN
DDMCR:		EQU	H#4		; Mc->RN; R0->QN
DLN.RECOVER:	EQU	H#5		; MN->RN; R0->QN
DDZR:		EQU	H#6		; 0->RN; R0->QN
DDZRQMC:	EQU	H#7		; 0->RN; R0->QN; Q0->Mc
SDROTMC:	EQU	H#8		; ROT.R; R0->Mc; ROT.Q
SDROTC:		EQU	H#9		; ROT.R WITH Mc; ROT.Q
SDROT:		EQU	H#A		; ROT.R; ROT.Q
SDIC:		EQU	H#B		; Ic->RN; R0->QN
DDROTC:		EQU	H#C		; Mc->RN; R0->QN; Q0->Mc
DDROTMC:	EQU	H#D		; Q0->RN; R0->QN; Q0->Mc
DDINIOVR:	EQU	H#E		; IN EXOR IOVR -> RN; R0->QN
DDROT:		EQU	H#F		; DOUBLE PRECISION ROTATE DOWN
;
;
; UP SHIFTING
;
SURZQZ:		EQU	H#2		; R0<-0; Q0<-0
;
;
; SHIFT ENABLES
;
SE.EN:		EQU	B#0		; ENABLE SHIFTING
SE.DIS:		EQU	B#1		; DISABLE SHIFTING
;
;
;
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
; Am2904 STATUS REGISTER INSTRUCTION CODES
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
; MACHINE STATUS REGISTER INSTRUCTION CODES
;    I5-I4-I3-I2-I1-I0 AND EZ-EC-EN-EOVR-CEM ENABLES
; MICRO STATUS REGISTER INSTRUCTION CODES
;    I5-I4-I3-I2-I1-I0 AND CEu ENABLE
;
; THE FOLLOWING TAKES THESE ALL TOGETHER - YOU MAY WISH TO DO THIS ANOTHER WAY
;
; ORDER: 543 210 ZCNOVR CEM CEu
;        Q#  Q#  H#     B#  B#
;
ONELEVEL:	EQU   	12Q#0000	; Y -> MSR; MSR -> USR
SET.MSR:	EQU	12Q#0101	; SET MACRO STATUS ONLY
SET.USR:	EQU	12Q#0176	; SET MICRO STATUS ONLY
SWAP.REG:	EQU	12Q#0200	; MSR <--> USR
;
LOAD.MSR:	EQU	12Q#2001	; ALU STATUS -> MSR
; THE ABOVE IS ON OF SEVERAL CODES - YOU DON'T NEED THEM ALL!
;
LOAD.USR:	EQU	12Q#2076	; ALU STATUS -> USR
; DITTO!
;
LOAD.BOTH:	EQU	12Q#2000	; ALU -> MSR, USR
; AGAIN DITTO!
;
LDINVRTM: 	EQU	12Q#3001	; ALU -> MSR; Ic INVERTED
LDINVRTU:	EQU	12Q#3076	; ALU -> USR; Ic INVERTED
LOAD.INVERT:	EQU	12Q#3000	; ALU -> MSR, USR; Ic INVERTED
;
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
; Am2904 CONDITION CODE OUTPUT INSTRUCTION CODES
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
; caution!  I5-I4-I3-I2-I1-I0 ARE ALSO USED FOR TESTING!!!!
; ENABLE TESTING VIA OEct ENABLE
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
TESTMZ:		EQU	12Q#4477  	; NO STATUS OPERATION
TESTMOVR:	EQU	12Q#4677	; NO STATUS OPERATION
TESTMC:		EQU	12Q#5277	; NO STATUS OPERATION
TESTMN:		EQU	12Q#5677	;
TEST.IOVR:	EQU	12Q#6677	;
TEST.IC:	EQU	12Q#7277	;
;
;
; TEST ENABLE
;
OECTEN:		EQU	B#0
OECTDIS:	EQU	B#1
;
;
; OUTPUT ENABLE
;
OEYEN:		EQU	B#0
OEYDIS:		EQU	B#1
;
; INSTRUCTION ENABLE
;
IEN:		EQU	B#0
IENDIS:		EQU	B#1
;
;
; CONDITIONAL CODE MULTIPLEXER (DATA MONITOR)
;
NOACK:		EQU	Q#0 
COUT:		EQU	Q#1 
PASS:		EQU	Q#7 
;
;
;
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
; TWO ADDRESS OPERATION - NO EXPANDED MEMORY
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
;
AM2903:  DEF 19X, 3VQ#0, 4VH#F, 4VH#C, 2VB#00, 4VH#0, 4VH#0, 1VB#0, 1VB#0, 22X
;  DEFAULTS       RAMAB  OR     YBUS   NOCin   R0     R0     IEN    OEY.EN
;
;
AM2910:   DEF   4VH#E, 3VX, 12V$X, 45X
; DEFAULTS      CONT   #    #
;
AM2904:   DEF   42X,	12VQ#2001, 1VB#1,  1VB#0, 4VX,  1VB#1, 3X
; DEFAULTS              LOAD.MSR   OECTDIS OEYEN  X     SE.DIS
;
SHIFT:    DEF   56X,  4VX, 1B#0, 3X
;                     SHIFT SE.EN
TEST:     DEF   42X, 12VQ#7777, 1VB#0, 9X
;                    DISABLED   OECTEN
STATUS:   DEF   42X, 12VQ#2001, B#1, 1VB#0, 4X, B#1, 3X
;                    LOAD.MSR  NO CT OEYEN     SE.DIS
 
;
; ADDED STATEMENTS FOR DATA MONITOR PROBLEM
;
NOP2903:  DEF   19X, Q#0, H#F, H#C, B#00, H#0, H#0, B#0, B#1, 22X
;
CTRL:     DEF   61X, 1VB#0, 1VB#0, 1VB#0
;                    DATAin DATAout MEMORY MAP SELECT
;                    CTRL   CTRL    FIRST QUADRANT
;
;
;
END
