TITLE DEMO SRC FILE FOR AM29116.DEF - D. E. WHITE - JAN 12, 1982 EDIT
;
; D.E.WHITE   OCT. 17, 1980
; EDITED DEC. 30, 1981
; EDITED JAN. 12, 1982
;
;
;
; This file was created just to debug the master file, CONTROLR.DEF.  It
; exercises the Am29116 DEF statements to demonstrate their usage.
;
;
;
;
;
; Advanced Micro Devices reserves the right to make changes in its product
; without notice in order to improve design or performance characteristics.
; The company assumes no responsibility for the use of any circuits or
; programs described herein.
;
; Am29116 Mnemonics Copyright  c  Advanced Micro Devices, Inc.
;
;
;
;
;
EJECT
;
;
;
; FREE FORMAT CONSTANTS
;
	FF1:	EQU	4H#E	; AM2910 CONTINUE
	FF4:	EQU	5B#01000 ; AM29116 ENABLES
;
;  Additional mnemonics may be defined in the .SRC file as needed so that the
;  .DEF file does not need to be re-assembled.	This should be minimized for
;  proper documentation
;
;     NOTE: the below is a BLANK line - AMDASM accepts it

; NO OPERATION
;
	NOOP
;
EJECT
;
;
;
; SINGLE OPERAND INSTRUCTIONS
;
;
	SOR	,,, W, MOVE, SORA, R10		; ACC <- R10
	SOR	,,, W, INC,  SORA, R31		; R31 <- R31 + 1
	SOR	,,, W, NEG,  SORA, R31		; ACC <- NOT R31 + 1
	SOR	,,, W, COMPORA, R31	     ; ACC <- NOT R31
;
	SONR	,,, W, MOVE, SOI,  NRS		; STATUS <- NEXT WORD
	FF	H#E, 15X, H#0123, B#01000, 24X	; DATA FOR ABOVE
;
	SONR	,,, W, NEG,  SOI,  NRA		; ACC <- NOT I + 1
	FF	H#E, 15X, H#0000, B#01000, 24X	; DATA FOR ABOVE
;
;	The above is an example of the free-format executable statement.
;	It supplies data for the two-microcycle immediate data instructions.
EJECT
;
;
; TWO OPERAND INSTRUCTIONS
;
;
	TOR1	,,, W, TODRR, SUBS, R31 	; R31 <- R31-<DATA LATCH>
;
	TOR1	,,, W, TORIY, AND,  R0		; Y <- R0 AND IMMEDIATE
	FF	FF1, 15X, H#ABCD, FF4, 24X	; DATA FOR ABOVE
;
	OR1    ,,, B, TORAA, ADD,  R31	       ; ACC <- R31 + ACC
;
	TOR2	,,, W, TODIR, SUBS, R0		; R0 <- DATA - IMMEDIATE
	FF	FF1, 15X, H#0002, FF4, 24X	; DATA FOR THE ABOVE
;
	TOR2	,,, W, TODAR, EXOR, R30 	; R30 <- D EXOR ACC
;
	TONR	,,, W, TOAI, ADDC,  NRA 	; ACC <= ACC + I + CIN
	FF	FF1, 15X, H#5555, FF4, 24X	; DATA FOR ABOVE
;
	TONR	,,, W, TODA, AND,   NRA 	; ACC <- D AND ACC
	TONR	,,, B, TODA, SUBS,  NRA 	; ACC <- D - ACC
;
EJECT
; SINGLE BIT SHIFT INSTRUCTIONS
;
;
	SHFTR	,,, W, SHRR, SHUP1, R10 	; SHIFT R10 <- 1
	SHFTR	,,, W, SHRR, SHUPL, R10 	; SHIFT R10 <- QLINK
	SHFTR	,,, W, SHRR, SHDNZ, R10 	; SHIFT 0 ->R10
;
	SHFTNR	,,, W, SHA,  SHDNOV,NRA 	; SHIFT QN XOR QOVR ->ACC
;
;
;
; ROTATE INSTRUCTIONS
;
;
	ROTR1	,,, W, H#8,  RTRA,  R10 	; ACC <- R10
	ROTR1	,,, W, H#F,  RTRR,  R31 	; R31 <- R31
;
	ROTR2	,,, W, H#3,  RTAR,  R10 	; R10 <- ACC
;
	ROTNR	,,, W,	     H#5,   RTAA	; ACC <- ACC
	ROTNR	,,, W,	     H#E,   RTDA	; ACC <- DATA LATCH
;
;
;
; BIT-ORIENTED INSTRUCTIONS
;
;
	BOR1	,,, W, H#6,  SETNR, R10 	; SET BIT 6
	BOR1	,,, W, H#8,  RSTNR, R10 	; RESET BIT 8
	BOR1	,,, W, H#F,  TSTNR, R31 	; TEST BIT 15
;
	BOR2	,,, W, H#C,  S2NR,  R31 	; R31 <- R31 - 2**12
;
	BONR	,,, W, H#3,	   RSTNA       ; RESET BIT 3 IN ACC
	BONR	,,, W, H#C,	    LD2NA	; ACC <- 2**12
	BONR	,,, W, H#3,	    RSTND	; RESET BIT 3, DATA LATCH
;
EJECT
; ROTATE AND MERGE INSTRUCTIONS
;
;
		   ; R6 <- ACC AND R6 OR NOT ACC AND D (ROTATED)
;
	ROTM	,,, W, H#6,  MDRA,  R6
;
	ROTM	,,, W, H#B,  MARI,  R6
	FF	FF1, 15X, H#AAAA, FF4, 24X
;
;
;
; ROTATE AND COMPARE INSTRUCTIONS
;
;
	ROTC	,,, W, H#6,  CDAI,  R5		; D ACC I (R?)
	FF	FF1, 15X, H#1874, FF4, 24X
;
	ROTC	,,, W, H#C,  CRAI,  R6
	FF	FF1, 15X, H#5656, FF4, 24X
;
;
;
; PRIOITIZE INSTRUCTIONS
;
;
	PRT1	,,, W, PR1A, PRT1A, R6
;
	PRT2	,,, W, PRA,  PR2A,  R6
;
	PRT3	,,, W, PRA,  PR3R,  R6
;
	PRTNR	,,, W, PRA,  PRTA,  NRY
;
EJECT
; CRC INSTRUCTIONS (SINGLE CALL)
;
;
	CRCF	,,, R6				; CRC FORWARD
;
	CRCR	,,, R6				; CRC REVERSE
;
;
;
; STATUS INSTRUCTIONS
;
;
	SETST	,,, SONZC			; SET ALU STATUS
	SETST	,,, SF3 			; SET FLAG 3
;
	RSTST	,,, RF2 			; RESET FLAG 2
	RSTST	,,, RONCZ			; RESET ALU STATUS
;
	SVSTR	,,, W, R6			; 6 <- STATUS
	SVSTNR	,,, W, NRA			; ACC <- STATUS
;
;
;
; TEST STATUS INSTRUCTIONS
;
;
	TEST	,,, TZ				; TEST Z
	TEST	,,, TF1 			; TEST FLAG 1
	TEST	,,, TNO 			; TEST N EXOR OVR
	TEST	,,, TC				; TEST C
;
;
;
;
;
;
END
