  Thu Apr 20 1989 11:55                                                                                                  Page    1







               2500 A.D. 68020 Macro Assembler - Version 4.01a
               -----------------------------------------------

                       Input  Filename : CAN68020.ASM
                       Output Filename : CAN68020.obj


    1                                  	;---------------------------------------------------------
    2                                  	; CANNED PROGRAM OF MICE III-68020
    3                                  	;   0H - 07FH : Used as CAN_BUFFER
    4                                  	; 080H - 09FH : Used as Parameter buffer
    5                                  	;----------------------------------------------------------------
    6   00000120                       		ORG	$120		;CAN_PROGRAM START AT (PC) + 120H
    7                                  		;
    8   00000120                       	CAN_START:
    9   00000120   60FE                	STOP:	BRA	STOP		;JMP CURRENT PC
   10   00000122   4E71                		NOP
   11                                  		;
   12                                  	;----------------------------------------------------------------
   13                                  	; GET_PARAMATER AND ENTRY POINT OF SUBROUTINE			-
   14                                  	; I/P : Save parameter to can-parameter-buffer			-
   15                                  	; O/P : (FLAG) : 0 -- ok					-
   16                                  	;		FF -- error					-
   17                                  	; bank_word / A0 : Canned buffer starting address (addr2)	-
   18                                  	; 100h~103h / A1 : Source starting address. (addr1)		-
   19                                  	; 104h~107h / A2 : Source ending address. (addr2)		-
   20                                  	; 108h~10bh / A3 : Destination address. (addr3) 		-
   21                                  	;	      A4 : Pointer of flag byte 			-
   22                                  	; 10ch~10fh / A5 : pointer of subroutine			-
   23                                  	; 110h~111h / D6 : memory verify flag				-
   24                                  	; SFC : Source area accessing function code			-
   25                                  	; DFC : Destination area accessing function code		-
   26                                  	;----------------------------------------------------------------
   27   00000124                       	GET_PARAMETER:
   28   00000124   49FA FEDA           		LEA	-$126(PC),A4	;A4 POINT TO CAN BUFFER
   29   00000128   204C                		MOVE.L	A4,A0		;A0 POINT TO CANNED BUFFER STARTING ADDR
   30   0000012A   D8FC 0100           		ADD.W	#$100,A4	;A4 POINT TO PARAMETER BUFFER
   31   0000012E   225C                		MOVE.L	(A4)+,A1	;STORE addr1 TO A1
   32   00000130   245C                		MOVE.L	(A4)+,A2	;STORE addr2 TO A2
   33   00000132   265C                		MOVE.L	(A4)+,A3	;STORE addr3 TO A3
   34   00000134   2A5C                		MOVE.L	(A4)+,A5	;STORE subroutine STARTING ADDRESS TO A5
   35   00000136   4280                		CLR.L	D0		;CLEAR D0
   36   00000138   3014                		MOVE.W	(A4),D0 	;SET SFC/DFC TO D0
   37   0000013A   2200                		MOVE.L	D0,D1		;MOVE SFC/DFC TO D1
   38   0000013C   4E7B 0000           		MOVEC	D0,SFC		;SET SFC
   39   00000140   E609                		LSR.B	#3,D1		;RIGHT SHIFT D1 3 bits
   40   00000142   4E7B 1001           		MOVEC	D1,DFC		;SET DFC
   41   00000146   E809                		LSR.B	#4,D1		;RIGHT SHIFT D1 4 bits
   42   00000148   2C01                		MOVE.L	D1,D6		;D6 --> MEMORY VERIFY FLAG
   43   0000014A   4ED5                		JMP	(A5)		;JMP TO subroutine START ADDRESS
   44                                  		;
   45                                  	;----------------------------------------------------------------
   46                                  	; GET REGISTER :						-
   47                                  	; I/P : NONE							-
  Thu Apr 20 1989 11:55                                                                                                  Page    2




   48                                  	; O/P : Save all register contents to CAN-buffer		-
   49                                  	;	0 - 3BH : D0 -- D7,A0 -- A7				-
   50                                  	;	3CH-5BH : USP,MSP,ISP,SFC,DFC,VBR,CACR,CAAR		-
   51                                  	; note: BANK0 : 	0H -	   7FFH 			-
   52                                  	;	BANK1 : 040000000H - 0400007FFH 			-
   53                                  	;	BANK2 : 080000000H - 0800007FFH 			-
   54                                  	;	BANK3 : 0C0000000H - 0C00007FFH 			-
   55                                  	;----------------------------------------------------------------
   56   0000014C                       	BANK0:
   57   0000014C   48F8 7FFF 0000      		MOVEM.L D0-D7/A0-A6,$0	;PUSH D0 -- D7,A0 -- A6 TO 0H
   58   00000152   207C 0000 003C      		MOVE.L	#$03C,A0	    ;A0 POINT TO CAN BUFFER + 03CH
   59   00000158   60FF 0000 0040      		BRA	SAVE_CNTL_REG	    ;JMP TO GET OTHER REGISTER ROUTINE
   60                                  		;
   61   0000015E                       	BANK1:
   62   0000015E   48F9 7FFF 4000 0000 		MOVEM.L D0-D7/A0-A6,$40000000	;PUSH D0 -- D7,A0 -- A6 TO 40000000H
   63   00000166   207C 4000 003C      		MOVE.L	#$4000003C,A0	;AO POINT TO CAN BUFFER +03CH
   64   0000016C   60FF 0000 002C      		BRA	SAVE_CNTL_REG	    ;JMP TO GET OTHER REGISTER ROUTINE
   65                                  		;
   66   00000172                       	BANK2:
   67   00000172   48F9 7FFF 8000 0000 		MOVEM.L D0-D7/A0-A6,$80000000	;PUSH D0 -- D7,A0 -- A6 TO 80000000H
   68   0000017A   207C 8000 003C      		MOVE.L	#$8000003C,A0	;A0 POINT TO CAN BUFFER + 03CH
   69   00000180   60FF 0000 0018      		BRA	SAVE_CNTL_REG	    ;JMP TO GET OTHER REGISTER ROUTINE
   70                                  		;
   71   00000186                       	BANK3:
   72   00000186   48F9 7FFF C000 0000 		MOVEM.L D0-D7/A0-A6,$0C0000000 ;PUSH D0 -- D7,A0 -- A6 TO 0C000000H
   73   0000018E   207C C000 003C      		MOVE.L	#$0C000003C,A0	;A0 POINT TO CAN BUFFER + 03CH
   74   00000194   60FF 0000 0004      		BRA	SAVE_CNTL_REG	    ;JMP TO GET OTHER REGISTER ROUTINE
   75                                  		;
   76   0000019A                       	SAVE_CNTL_REG:
   77   0000019A   4E7A 0800           		DW	$4E7A,$800		;PUSH USP TO D0
   78   0000019E   20C0                		MOVE.L	D0,(A0)+	    ;SAVE USP TO CAN BUFFER
   79   000001A0   4E7A 0803           		DW	$4E7A,$803		;PUSH MSP TO D0
   80   000001A4   20C0                		MOVE.L	D0,(A0)+	    ;SAVE MSP TO CAN BUFFER
   81   000001A6   4E7A 0804           		DW	$4E7A,$804		;PUSH ISP TO D0
   82   000001AA   20C0                		MOVE.L	D0,(A0)+	    ;SAVE ISP TO CAN BUFFER
   83   000001AC   4E7A 0801           		DW	$4E7A,$801		;PUSH VBR TO D0
   84   000001B0   20C0                		MOVE.L	D0,(A0)+	    ;SAVE VBR TO CAN BUFFER
   85   000001B2   4E7A 0002           		DW	$4E7A,$002		;PUSH CACR TO D0
   86   000001B6   20C0                		MOVE.L	D0,(A0)+	    ;SAVE CACR TO CAN BUFFER
   87   000001B8   4E7A 0802           		DW	$4E7A,$802		;PUSH CAAR TO D0
   88   000001BC   20C0                		MOVE.L	D0,(A0)+	    ;SAVE CAAR TO CAN BUFFER
   89   000001BE   4E7A 0000           		MOVEC	SFC,D0		    ;PUSH SFC TO D0
   90   000001C2   20C0                		MOVE.L	D0,(A0)+	    ;SAVE SFC TO CAN BUFFER
   91   000001C4   4E7A 0001           		MOVEC	DFC,D0		    ;PUSH DFC TO D0
   92   000001C8   20C0                		MOVE.L	D0,(A0)+	    ;SAVE DFC TO CAN BUFFER
   93   000001CA   6000 FF54           		BRA	STOP			;JMP TO CAN_END
   94                                  		;
   95                                  	;----------------------------------------------------------------
   96                                  	;SAVE ALL REGISTER CONTERNS BACK				-
   97                                  	; I/P : A0 -- Can-buffer starting address			-
   98                                  	;	A1 -- Pointer of USP					-
   99                                  	;----------------------------------------------------------------
  100   000001CE                       	SAVALL:
  101   000001CE   2019                		MOVE.L	(A1)+,D0	;PUT USP TO D0
  102   000001D0   4E7B 0800           		DW	$4E7B,$800	    ;POP USP
  103   000001D4   2019                		MOVE.L	(A1)+,D0	;PUT MSP TO D0
  104   000001D6   4E7B 0803           		DW	$4E7B,$803	    ;POP MSP
  Thu Apr 20 1989 11:55                                                                                                  Page    3




  105   000001DA   2019                		MOVE.L	(A1)+,D0	;PUT ISP TO D0
  106   000001DC   4E7B 0804           		DW	$4E7B,$804	    ;POP ISP
  107   000001E0   2019                		MOVE.L	(A1)+,D0	;PUT VBR TO D0
  108   000001E2   4E7B 0801           		DW	$4E7B,$801	    ;POP VBR
  109   000001E6   2019                		MOVE.L	(A1)+,D0	;PUT CACR TO D0
  110   000001E8   4E7B 0002           		DW	$4E7B,$002	    ;POP CACR
  111   000001EC   2019                		MOVE.L	(A1)+,D0	;PUT CAAR TO D0
  112   000001EE   4E7B 0802           		DW	$4E7B,$802	    ;POP CAAR
  113   000001F2   2019                		MOVE.L	(A1)+,D0	;PUT SFC TO D0
  114   000001F4   4E7B 0000           		MOVEC	D0,SFC		;POP SFC
  115   000001F8   2019                		MOVE.L	(A1)+,D0	;PUT DFC TO D0
  116   000001FA   4E7B 0001           		MOVEC	D0,DFC		;POP DFC
  117   000001FE   4CD0 7FFF           		MOVEM.L (A0),D0-D7/A0-A6 ;POP D0 -- D7,A0 --A6
  118   00000202   6000 FF1C           		BRA	STOP		    ;JMP TO CAN END
  119                                  		;
  120                                  	;-------------------- 68881 get register ------------------------------
  121   00000206                       	GET68881:
  122   00000206   1030 0170 0008 0000 		move.b	(+$80000,a0), d0	;enable trigger WR yeh:12/30/88
  123   0000020E   F210 F0FF           		dw	$0f210,$0f0ff		;FMOVEM.X  FP0-FP7, (A0)
  124   00000212   D1FC 0000 0060      		ADDA.L	  #$060,A0		; adjust A0 pointer
  125   00000218   F218 B000           		dw	$0f218,$0b000		;FMOVE.L   FPCR, (A0)+
  126   0000021C   F218 A800           		dw	$0f218,$0a800		;FMOVE.L   FPSR, (A0)+
  127   00000220   F218 A400           		dw	$0f218,$0a400		;FMOVE.L   FPIAR, (A0)+
  128   00000224   6000 FEFA           		BRA	  STOP
  129                                  	
  130                                  	;-------------------- 68881 save register -----------------------------
  131   00000228                       	SAVE68881:
  132   00000228   1030 0170 0008 0000 		move.b	(+$80000,a0), d0	;enable trigger WR yeh:12/30/88
  133   00000230   F210 D0FF           		dw	$0f210,$0d0ff		;FMOVEM.X  (A0), FP0-FP7
  134   00000234   D1FC 0000 0060      		ADDA.L	  #$060,A0		; adjust A0 pointer
  135   0000023A   F218 9000           		dw	$0f218,$09000		;FMOVE.L   (A0)+, FPCR
  136   0000023E   F218 8800           		dw	$0f218,$08800		;FMOVE.L   (A0)+, FPSR
  137   00000242   F218 8400           		dw	$0f218,$08400		;FMOVE.L   (A0)+, FPIAR
  138   00000246   6000 FED8           		BRA	  STOP
  139                                  	
  140                                  	;================================================================
  141                                  	; DISPLAY MEMORY						=
  142                                  	; A0 : Can-buffer starting address				=
  143                                  	; A1 : pointer for memory to be displayed			=
  144                                  	; A2 : Ending address OF MEMORY 				=
  145                                  	;================================================================
  146                                  	
  147                                  	;----------------------------------------------------------------
  148                                  	; Display memory with BYTE format
  149                                  	;----------------------------------------------------------------
  150   0000024A                       	DISP_B_MEMORY:
  151   0000024A   2649                		MOVE.L	A1,A3		;SAVE START ADDRESS TO A3
  152   0000024C                       	DISP_B1:
  153   0000024C   0E19 0000           		MOVES.B (A1)+,D0	;GET MEMORY DATA FROM SOURCR address
  154   00000250   E148                		LSL.W	#8,D0		;SHIFT TO HIGH BYTE
  155   00000252   B3CB                		CMP.L	A3,A1		;CURRENT ADDRESS < START ADDRESS ?
  156   00000254   65FF 0000 0010      		BCS	PUT_MRY 	    ;YES THEN END JOB
  157   0000025A   B5C9                		CMP.L	A1,A2		;END ADDRESS ?
  158   0000025C   65FF 0000 0008      		BCS	PUT_MRY 	    ;YES, SAVE LAST DATA
  159   00000262   0E19 0000           		MOVES.B (A1)+,D0	;LOAD NEXT BYTE TO LOW BYTE
  160   00000266                       	PUT_MRY:
  161   00000266   30C0                		MOVE.W	D0,(A0)+	;PUT MEMORY DATA TO CAN BUFFER
  Thu Apr 20 1989 11:55                                                                                                  Page    4




  162   00000268   B3CB                		CMP.L	A3,A1		;CURRENT ADDRESS < START ADDRESS ?
  163   0000026A   6500 FEB4           		BCS	STOP		    ;YES THEN END JOB
  164   0000026E   B5C9                		CMP.L	A1,A2		;IS END ADDRESS ?
  165   00000270   64DA                		BCC	DISP_B1 	    ;NOT END,CONTINUE
  166   00000272   6000 FEAC           		BRA	STOP		    ;END,JMP TO CAN END
  167                                  		;
  168                                  	;----------------------------------------------------------------
  169                                  	; Display memory with WORD format
  170                                  	;----------------------------------------------------------------
  171   00000276                       	DISP_W_MEMORY:
  172   00000276   2649                		MOVE.L	A1,A3		;SAVE START ADDRESS TO A3
  173   00000278                       	DISP_W1:
  174   00000278   0E59 0000           		MOVES.W (A1)+,D0	;GET MEMORY DATA FROM SOURCR address
  175   0000027C   30C0                		MOVE.W	D0,(A0)+	;PUT MEMORY DATA TO CAN BUFFER
  176   0000027E   B3CB                		CMP.L	A3,A1		;CURRENT ADDRESS < START ADDRESS ?
  177   00000280   6500 FE9E           		BCS	STOP		    ;YES THEN END JOB
  178   00000284   B5C9                		CMP.L	A1,A2		;IS END ADDRESS ?
  179   00000286   64F0                		BCC	DISP_W1 	    ;NOT END,CONTINUE
  180   00000288   6000 FE96           		BRA	STOP		    ;END,JMP TO CAN END
  181                                  		;
  182                                  	;----------------------------------------------------------------
  183                                  	; Display memory with LONG-WORD format
  184                                  	;----------------------------------------------------------------
  185   0000028C                       	DISP_L_MEMORY:
  186   0000028C   2649                		MOVE.L	A1,A3		;SAVE START ADDRESS TO A3
  187   0000028E                       	DISP_L1:
  188   0000028E   0E99 0000           		MOVES.L (A1)+,D0	;GET MEMORY DATA FROM SOURCR address
  189   00000292   20C0                		MOVE.L	D0,(A0)+	;PUT MEMORY DATA TO CAN BUFFER
  190   00000294   B3CB                		CMP.L	A3,A1		;CURRENT ADDRESS < START ADDRESS ?
  191   00000296   6500 FE88           		BCS	STOP		    ;YES THEN END JOB
  192   0000029A   B5C9                		CMP.L	A1,A2		;IS END ADDRESS ?
  193   0000029C   64F0                		BCC	DISP_L1 	    ;NOT END,CONTINUE
  194   0000029E   6000 FE80           		BRA	STOP		    ;END,JMP TO CAN END
  195                                  		;
  196                                  	
  197                                  	;=================cancelled by yeh on 4/16/89====================
  198                                  	;	      replace all the fill function by block fill	=
  199                                  	;================================================================
  200                                  	; FILL MEMORY							=
  201                                  	; A0 : Can-buffer starting address				=
  202                                  	; A1 : Pointer for memory to be filled				=
  203                                  	; A2 : DATA COUNT						=
  204                                  	; A4 : Flg address						=
  205                                  	; D6 : VERIFY FLG						=
  206                                  	;================================================================
  207                                  	;----------------------------------------------------------------
  208                                  	; Fill memory with BYTE format
  209                                  	;----------------------------------------------------------------
  210                                  	;FILL_B_MEMORY:
  211                                  	;	 move.b  (+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  212                                  	;	 MOVE.B  #1,D4		 ;INITIAL EVEN/ODD FLAG
  213                                  	;	 MOVE.L  A2,D3		 ;MOVE COUNT TO D3
  214                                  	;	 MOVE.L  A0,A5		 ;INITIAL BUFFER COUNT
  215                                  	;FILL2_B:
  216                                  	;	 EORI.B  #1,D4		 ;ODD ?
  217                                  	;	 BNE	 FILL3_B	     ;YES, GET DATA FROM D0 HIGH BYTE
  218                                  	;	 MOVE.W  (A5)+,D0	 ;GET DATA INTO D0
  Thu Apr 20 1989 11:55                                                                                                  Page    5




  219                                  	;FILL3_B:
  220                                  	;	 ROR.W	 #8,D0		 ;SWAP HIGH/LOW BYTE
  221                                  	;	 MOVES.B D0,(A1)     ;PUT D0 TO MEMORY
  222                                  	;	 OR	 D6,D6		     ;NEED VERIFICATION
  223                                  	;	 BEQ	 FILL1_B	     ;NO,DON'T READ BACK DATA
  224                                  	;	 MOVES.B (A1),D1	 ;READ BACK DATA
  225                                  	;	 CMP.B	 D0,D1		 ;WRITE CORRECT ?
  226                                  	;	 BNE	 RAMERR 	     ;NO, SET ERR. FLG
  227                                  	;FILL1_B:
  228                                  	;	 ADDQ.L  #1,A1		 ;SRC ADDR + 1
  229                                  	;	 SUBQ.L  #1,D3		 ;COUNT=0 ?
  230                                  	;	 BNE	 FILL2_B	     ;NOT END,CONTINUE
  231                                  	;	 BRA	 STOP		     ;END,JMP TO CAN END
  232                                  	;	 ;
  233                                  	;;----------------------------------------------------------------
  234                                  	;; Fill memory with WORD format
  235                                  	;;----------------------------------------------------------------
  236                                  	;FILL_W_MEMORY:
  237                                  	;	 move.b  (+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  238                                  	;	 MOVE.L  A2,D3		 ;MOVE COUNT TO D3
  239                                  	;	 MOVE.L  A0,A5		 ;INITIAL BUFFER COUNT
  240                                  	;FILL1_W:
  241                                  	;	 MOVE.W  (A5)+,D0	 ;PUT DATA INTO D0
  242                                  	;	 MOVES.W D0,(A1)	 ;PUT D0 TO MEMORY
  243                                  	;	 OR	 D6,D6		     ;NEED VERIFICATION
  244                                  	;	 BEQ	 FILL2_W	     ;NO,DON'T READ BACK DATA
  245                                  	;	 MOVES.W (A1),D1	 ;READ BACK DATA
  246                                  	;	 CMP.W	 D0,D1		 ;WRITE CORRECT ?
  247                                  	;	 BNE	 RAMERR 	     ;NO, SET ERR. FLG
  248                                  	;FILL2_W:
  249                                  	;	 ADDQ.L  #2,A1		 ;SRC SDDR + 1
  250                                  	;	 SUBQ.L  #2,D3		 ;COUNT=0 ?
  251                                  	;	 BNE	 FILL1_W	     ;NOT END,CONTINUE
  252                                  	;	 BRA	 STOP		     ;END,JMP TO CAN END
  253                                  	;	 ;
  254                                  	;;----------------------------------------------------------------
  255                                  	;; Fill memory with LONG-WORD format
  256                                  	;;----------------------------------------------------------------
  257                                  	;FILL_L_MEMORY:
  258                                  	;	 move.b  (+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  259                                  	;	 MOVE.L  A2,D3		 ;MOVE COUNT TO D3
  260                                  	;	 MOVE.L  A0,A5		 ;INITIAL BUFFER COUNT
  261                                  	;FILL1_L:
  262                                  	;	 MOVE.L  (A5)+,D0	 ;PUT DATA INTO D0
  263                                  	;	 MOVES.L D0,(A1)	 ;PUT D0 TO MEMORY
  264                                  	;	 OR	 D6,D6		     ;NEED VERIFICATION
  265                                  	;	 BEQ	 FILL2_L	     ;NO,DON'T READ BACK DATA
  266                                  	;	 MOVES.L (A1),D1	 ;READ BACK DATA
  267                                  	;	 CMP.L	 D0,D1		 ;WRITE CORRECT ?
  268                                  	;	 BNE	 RAMERR 	     ;NO, SET ERR. FLG
  269                                  	;FILL2_L:
  270                                  	;	 ADDQ.L  #4,A1		 ;SRC ADDR + 1
  271                                  	;	 SUBQ.L  #4,D3		 ;IS END ADDRESS ?
  272                                  	;	 BNE	 FILL1_L	     ;COUNT=0 ?
  273                                  	;	 BRA	 STOP		     ;END,JMP TO CAN END
  274                                  	;	 ;
  275                                  	;===================================================== deleted ==
  Thu Apr 20 1989 11:55                                                                                                  Page    6




  276                                  	
  277                                  	
  278                                  	;================================================================
  279                                  	; BLOCK FILL							=
  280                                  	; A0= Canned-buffer Starting address				=
  281                                  	; A1= Source Starting address					=
  282                                  	; A2= Source Ending address					=
  283                                  	; A3= Length of available data buffer				=
  284                                  	; A4= Flg address						=
  285                                  	; D6= Verify flg						=
  286                                  	;================================================================
  287                                  	;----------------------------------------------------------------
  288                                  	; Block fill with BYTE format
  289                                  	;----------------------------------------------------------------
  290   000002A2                       	BLOCK_B_FILL:
  291   000002A2   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  292   000002AA                       	bkfb_001:
  293   000002AA   2A48                		MOVE.L	A0,A5		;SAVE START ADDRESS OF CANNED BUFFER
  294   000002AC   240B                		MOVE.l	A3,D2		;INITIAL COUNT
  295   000002AE                       	bkfb_002:
  296   000002AE   121D                		MOVE.b	(A5)+,D1	;READ CURRENT DATA FROM CANNED BUFFER
  297   000002B0   0E11 1800           		MOVES.B D1,(A1) 	;WRITE DATA TO MEMORY
  298                                  	
  299   000002B4   4A86                		tst.l	D6		;NEED VERIFICATION ?
  300   000002B6   67FF 0000 0010      		BEQ	bkfb_003	;NO, DON'T READ BACK DATA
  301   000002BC   0E11 3000           		MOVES.B (A1),D3 	;READ BACK DATA
  302   000002C0   B601                		CMP.B	D1,D3		;WRITE CORRECT ?
  303   000002C2   66FF 0000 0582      		BNE	RAMERR		;NO, SET ERR. FLG
  304   000002C8                       	bkfb_003:
  305   000002C8   B5C9                		CMP.L	A1,A2		;A1>=A2 ?
  306   000002CA   6300 FE54           		BLS	STOP		;YES, END FILL
  307   000002CE   5289                		ADDQ.L	#1,A1		;SRC ADDR + 1
  308   000002D0   5382                		SUBQ.L	#1,D2		;COUNT-1
  309   000002D2   66DA                		BNE	bkfb_002	;COUNTINUE, IF COUNT NOT ZERO
  310   000002D4   60D4                		BRA	bkfb_001	;INITIAL ADDR. AND COUNT OF CANNED BUFFER
  311                                  					;IF COUNT=0 (END OF DATA)
  312                                  	
  313                                  	;BLOCK_B_FILL:
  314                                  	;	 move.b  (+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  315                                  	;	 MOVE.L  A0,A5		 ;SAVE START ADDRESS OF CANNED BUFFER
  316                                  	;	 MOVE.L  A3,D2		 ;INITIAL COUNT
  317                                  	;	 MOVE.B  #1,D4		 ;INITIAL EVEN/ODD FLAG
  318                                  	;CNTFILL_B:
  319                                  	;	 EORI.B  #1,D4		 ;ODD ?
  320                                  	;	 BNE	 CNTFILL1_B	 ;YES,GET DATA FROM D1 HIGH BYTE
  321                                  	;	 MOVE.W  (A5)+,D1	 ;READ CURRENT DATA FROM CANNED BUFFER
  322                                  	;CNTFILL1_B:
  323                                  	;	 ROR.W	 #8,D1		 ;ROTATE HIGH/LOW BYTE
  324                                  	;	 MOVES.B D1,(A1)	 ;WRITE DATA TO MEMORY
  325                                  	;	 OR	 D6,D6		 ;NEED VERIFICATION ?
  326                                  	;	 BEQ	 BLCK1_B	 ;NO, DON'T READ BACK DATA
  327                                  	;	 MOVES.B (A1),D3	 ;READ BACK DATA
  328                                  	;	 CMP.B	 D1,D3		 ;WRITE CORRECT ?
  329                                  	;	 BNE	 RAMERR 	 ;NO, SET ERR. FLG
  330                                  	;BLCK1_B:
  331                                  	;	 CMP.L	 A1,A2		 ;A1>=A2 ?
  332                                  	;	 BLS	 STOP		 ;YES, END FILL
  Thu Apr 20 1989 11:55                                                                                                  Page    7




  333                                  	;	 ADDQ.L  #1,A1		 ;SRC ADDR + 1
  334                                  	;	 SUBQ.L  #1,D2		 ;COUNT-1
  335                                  	;	 BNE	 CNTFILL_B	 ;COUNTINUE, IF COUNT NOT ZERO
  336                                  	;	 BRA	 BLOCK_B_FILL	 ;INITIAL ADDR. AND COUNT OF CANNED BUFFER
  337                                  	;				 ;IF COUNT=0 (END OF DATA)
  338                                  	
  339                                  	;----------------------------------------------------------------
  340                                  	; BKFW_ : BlocK Fill Word format, (replaced by yeh on 4/15/89
  341                                  	;----------------------------------------------------------------
  342   000002D6                       	BLOCK_W_FILL:
  343   000002D6   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:4/15/89
  344   000002DE   240A                		move.l	a2,d2	    ; D2=A2
  345   000002E0   9489                		sub.l	a1,d2
  346                                  	
  347   000002E2   B783                		eor.l	d3,d3	    ; clear D3=data count=0
  348   000002E4   5282                		addq.l	#1,d2	    ; D2=length of destination
  349   000002E6   2009                		move.l	a1,d0	    ; D0=A1=starting
  350                                  	
  351   000002E8   0280 0000 0001      		andi.l	#1b,d0	    ; D0=boundary offset, boundary test
  352   000002EE   67FF 0000 005C      		beq	BKFW_102    ; branch if WORD boundary, D0=boundary frame
  353                                  	
  354                                  		;-------------------- starting addr. not WORD boundary
  355   000002F4   2209                		move.l	a1,d1	    ; A1=A1 & fffffffeh (starting)
  356   000002F6   0281 FFFF FFFE      		andi.l	#fffffffeh,d1
  357   000002FC   2241                		move.l	d1,a1
  358                                  	
  359   000002FE   0E51 1000           		moves.w (a1),d1     ; D1=read target WORD data
  360                                  	
  361   00000302   E159                		rol.w	#8,d1	    ; rotate WORD data
  362                                  	
  363                                  		;-------------------- data parsing
  364   00000304                       	BKFW_001:
  365   00000304   4A83                	        tst.l   d3          ; test data buffer length
  366   00000306   66FF 0000 0008      	        bne     BKFW_002    ; branch if not data boundary.
  367   0000030C                       	    
  368   0000030C   2A48                		movea.l a0,a5	    ; data buffer starting
  369   0000030E   260B                		move.l	a3,d3	    ; D3=A3=data count
  370   00000310                       	BKFW_002:
  371   00000310   E159                		rol.w	#8,d1
  372   00000312   121D                		move.b	(a5)+,d1    ; fix data
  373   00000314   5382                		subq.l	#1,d2	    ; decrease length
  374   00000316   5383                		subq.l	#1,d3	    ; decrease data count
  375   00000318                       	BKFW_003:
  376   00000318   5200                		addq.b	#1,d0	    ; add offset
  377   0000031A   0C00 0002           		cmpi.b	#2,d0	    ; to boundary ?
  378   0000031E   67FF 0000 000C      		beq	BKFW_010    ; branch if WORD boundary
  379                                  	
  380   00000324   4A82                		tst.l	d2	    ; test target length
  381   00000326   66DC                		bne	BKFW_001    ; branch if not ended
  382   00000328   E159                		rol.w	#8,d1	    ; to ending
  383   0000032A   60EC                		bra	BKFW_003
  384                                  		;-------------------- write data to target & verify
  385   0000032C                       	BKFW_010:
  386   0000032C   0E51 1800           		moves.w d1,(a1)
  387   00000330   4A46                		tst	d6
  388   00000332   67FF 0000 0010      		beq	BKFW_011    ; branch if don't need verify
  389   00000338   0E51 0000           		moves.w (a1),d0     ; D0=read target WORD data again
  Thu Apr 20 1989 11:55                                                                                                  Page    8




  390   0000033C   B141                		eor.w	d0,d1	    ; verify
  391   0000033E   66FF 0000 0506      		bne	RAMERR
  392   00000344                       	BKFW_011:
  393   00000344   5489                		addq.l	#2,a1	    ; to next
  394                                  	
  395                                  		;-------------------- fited WORD boundary
  396                                  	BKFW_100:		    ; already on WORD boundary
  397   00000346   4A82                		tst.l	d2	    ; test D2=ending ?
  398   00000348   6700 FDD6           		beq	STOP
  399   0000034C                       	BKFW_102:
  400   0000034C   0C82 0000 0001      		cmpi.l	#1,d2	    ; test length
  401   00000352   62FF 0000 0008      		bhi	BKFW_101    ; branch if length >= 4
  402   00000358   0E51 1000           		moves.w (a1),d1     ; D1=read target WORD data
  403   0000035C                       	BKFW_101:
  404   0000035C   7000                		moveq.l #0,d0
  405   0000035E   60A4                		bra	BKFW_001    ; branch to buffer test & data parsing
  406                                  	
  407                                  	;----------------------------------------------------------------
  408                                  	; BKFL_ : BlocK Fill Long format, (replaced by yeh on 4/15/89
  409                                  	;----------------------------------------------------------------
  410   00000360                       	BLOCK_L_FILL:
  411   00000360   1030 0170 0008 0000 	        move.b  (+$80000,a0), d0 ; enable trigger WR yeh:4/15/89
  412   00000368   240A                		move.l	a2,d2	    ; D2=A2=ending address
  413   0000036A   9489                		sub.l	a1,d2       ; D2=A2-A1=length
  414   0000036C                       		
  415   0000036C   B783                		eor.l	d3,d3	    ; clear D3=data count
  416   0000036E   5282                		addq.l	#1,d2	    ; D2=length of destination
  417   00000370   2009                		move.l	a1,d0	    ; D0=A1=starting
  418                                  	
  419   00000372   0280 0000 0003      		andi.l	#11b,d0     ; D0=boundary offset, boundary test
  420   00000378   67FF 0000 0060      		beq	BKFL_102    ; branch if long boundary, D0=boundary frame
  421                                  	
  422                                  		;-------------------- starting addr. not long boundary
  423   0000037E   2209                		move.l	a1,d1	    ; A1=A1 & fffffffch
  424   00000380   0281 FFFF FFFC      		andi.l	#fffffffch,d1
  425   00000386   2241                		move.l	d1,a1
  426                                  	
  427   00000388   0E91 1000           		moves.l (a1),d1     ; D1=read target data
  428                                  	
  429   0000038C   E788                		lsl.l	#3,d0	    ; D0=D0*8
  430   0000038E   E1B9                		rol.l	d0,d1
  431   00000390   E688                		lsr.l	#3,d0	    ; restore D0
  432                                  	
  433                                  		;-------------------- data parsing
  434   00000392                       	BKFL_001:
  435   00000392   4A83                	        tst.l   d3          ; test data buffer length
  436   00000394   66FF 0000 0008      	        bne     BKFL_002    ; branch if not data boundary.
  437                                  	
  438   0000039A   2A48                		movea.l a0,a5	    ; data buffer starting
  439   0000039C   260B                		move.l	a3,d3	    ; D3=A3=data count
  440   0000039E                       	BKFL_002:
  441   0000039E   E199                		rol.l	#8,d1
  442   000003A0   121D                		move.b	(a5)+,d1    ; fix data
  443   000003A2   5382                		subq.l	#1,d2	    ; decrease D2=length
  444   000003A4   5383                		subq.l	#1,d3	    ; decrease D3=data buffer length
  445   000003A6                       	BKFL_003:
  446   000003A6   5200                		addq.b	#1,d0	    ; add offset
  Thu Apr 20 1989 11:55                                                                                                  Page    9




  447   000003A8   0C00 0004           		cmpi.b	#4,d0	    ; to boundary ?
  448   000003AC   67FF 0000 000C      		beq	BKFL_010    ; branch if long boundary
  449                                  	
  450   000003B2   4A82                		tst.l	d2	    ; test target length
  451   000003B4   66DC                		bne	BKFL_001    ; branch if not ended
  452   000003B6   E199                		rol.l	#8,d1	    ; to ending
  453   000003B8   60EC                		bra	BKFL_003
  454                                  		;-------------------- write data to target & verify
  455   000003BA                       	BKFL_010:
  456   000003BA   0E91 1800           		moves.l d1,(a1)
  457   000003BE   4A46                		tst	d6
  458   000003C0   67FF 0000 0010      		beq	BKFL_011    ; branch if don't need verify
  459   000003C6   0E91 0000           		moves.l (a1),d0     ; D0=read target data again
  460   000003CA   B181                		eor.l	d0,d1
  461   000003CC   66FF 0000 0478      		bne	RAMERR
  462   000003D2                       	BKFL_011:
  463   000003D2   5889                		addq.l	#4,a1
  464                                  	
  465                                  		;-------------------- fited long boundary
  466                                  	BKFL_100:		    ; already on long boundary
  467   000003D4   4A82                		tst.l	d2	    ; test D2=ending ?
  468   000003D6   6700 FD48           		beq	STOP
  469   000003DA                       	BKFL_102:
  470   000003DA   0C82 0000 0003      		cmpi.l	#3,d2
  471   000003E0   62FF 0000 0008      		bhi	BKFL_101    ; branch if length >= 4
  472   000003E6   0E91 1000           		moves.l (a1),d1     ; D1=read target data
  473   000003EA                       	BKFL_101:
  474   000003EA   7000                		moveq.l #0,d0
  475   000003EC   60A4                		bra	BKFL_001    ; branch to buffer test & data parsing
  476                                  	
  477                                  	;----------------------------------------------------------------
  478                                  	; The following paragraph are deleted by yeh on 4/14/89
  479                                  	;----------------------------------------------------------------
  480                                  	; Block fill with WORD format
  481                                  	;----------------------------------------------------------------
  482                                  	;BLOCK_W_FILL:
  483                                  	;	 move.b  (+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  484                                  	;	 SUBA.L  A1,A2		 ;GET RANGE LENGTH
  485                                  	;	 ADDQ.L  #1,A2		 ;
  486                                  	;	 MOVE.L  A2,D4		 ;MOVE LENGTH TO D4
  487                                  	;	 LSR.L	 #1,D4		 ;LET D4=LONG-WORD COUNT
  488                                  	;	 ADDQ.L  #1,D4		 ;
  489                                  	;BLCK_W:
  490                                  	;	 MOVE.L  A0,A5		 ;SAVE START ADDRESS OF CANNED BUFFER
  491                                  	;	 MOVE.L  A3,D2		 ;INITIAL COUNT
  492                                  	;CNTFILL_W:
  493                                  	;	 SUBQ.L  #1,D4		 ;END OF COUNT ?
  494                                  	;	 BEQ	 LAST_W_BLCK	 ;YES, FILL LAST DATA
  495                                  	;	 MOVE.W  (A5)+,D1	 ;READ CURRENT DATA FROM CANNED BUFFER
  496                                  	;	 MOVES.W D1,(A1)	 ;WRITE DATA TO MEMORY
  497                                  	;	 OR	 D6,D6		 ;NEED VERIFICATION ?
  498                                  	;	 BEQ	 BLCK1_W	 ;NO, DON'T READ BACK DATA
  499                                  	;	 MOVE.W  (A4),D3	 ;TURN OFF 245
  500                                  	;	 MOVES.W (A1),D3	 ;READ BACK DATA
  501                                  	;	 CMP.W	 D1,D3		 ;WRITE CORRECT ?
  502                                  	;	 BNE	 RAMERR 	 ;NO, SET ERR. FLG
  503                                  	;BLCK1_W:
  Thu Apr 20 1989 11:55                                                                                                  Page   10




  504                                  	;	 ADDQ.L  #2,A1		 ;SRC ADDR + 1
  505                                  	;	 SUBQ.L  #2,D2		 ;COUNT-1
  506                                  	;	 BNE	 CNTFILL_W	 ;COUNTINUE, IF COUNT NOT ZERO
  507                                  	;	 BRA	 BLCK_W 	 ;INITIAL ADDR. AND COUNT OF CANNED BUFFER
  508                                  	;				 ;	 IF COUNT=0 (END OF DATA)
  509                                  	;
  510                                  	;LAST_W_BLCK:
  511                                  	;	 MOVE.L  A2,D4		 ;MOVE RANGE LENGTH TO D4
  512                                  	;	 ANDI.L  #1,D4		 ;GET MOD(D4/4) TO D4
  513                                  	;	 BRA	 LAST_FILL	 ;FILL LAST DATA
  514                                  	;;----------------------------------------------------------------
  515                                  	;; Block fill with LONG-WORD format
  516                                  	;;----------------------------------------------------------------
  517                                  	;BLOCK_L_FILL:
  518                                  	;	 move.b  (+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  519                                  	;	 SUBA.L  A1,A2		 ;GET RANGE LENGTH
  520                                  	;	 ADDQ.L  #1,A2		 ;
  521                                  	;	 MOVE.L  A2,D4		 ;MOVE LENGTH TO D4
  522                                  	;	 MOVE.L  A1,D5		 ;GET MOD(A1/4) TO D5
  523                                  	;	 MOVE.L  A0,A5		 ;MOVE CANNED START TO A5
  524                                  	;	 MOVE.L  A3,D2		 ;DATA COUNT
  525                                  	;	 ANDI.L  #3,D5		 ;
  526                                  	;	 BEQ	 BLCK_L2	 ;DON'T PARTIAL FILL IF MOD=0
  527                                  	;	 MOVE.L  A1,D3		 ;LIMIT A1 AT BOUNDARY
  528                                  	;	 ANDI.L  #0FFFFFFFCH,D3  ;
  529                                  	;	 MOVE.L  D3,A1		 ;
  530                                  	;	 MOVE.L  #4,D3		 ;LONG-WORD= 4 X BYTES
  531                                  	;	 MOVES.L (A1),D1	 ;READ ALREADY EXIST DATA
  532                                  	;TRNCAT_L1:
  533                                  	;	 OR.L	 D3,D3		 ;COMPLETED 4 TIMES ?
  534                                  	;	 BEQ	 BLCK_L1	 ;YES, GOTO BLOCK FILL
  535                                  	;	 ROL.L	 #8,D1		 ;SHIFT NEXT ALREADY BYTE DATA
  536                                  	;	 SUBQ.L  #1,D3		 ;LONG_WORD-1
  537                                  	;	 SUBQ.L  #1,D5		 ;FILL THIS BYTE ?
  538                                  	;	 BPL	 TRNCAT_L1	 ;NO, NEXT BYTE
  539                                  	;	 OR.L	 D4,D4		 ;END OF BLOCK FILL JOB ?
  540                                  	;	 BEQ	 TRNCAT_L1	 ;YES, DON'T CHANG CURRENT DATA
  541                                  	;	 MOVE.B  (A5)+,D1	 ;NO, CHANG CURRENT DATA
  542                                  	;	 SUBQ.L  #1,D2		 ;COUNT-1
  543                                  	;	 SUBQ.L  #1,D4		 ;DECREASE DATA COUNT
  544                                  	;	 BRA	 TRNCAT_L1	 ;GOTO NEXT BYTE
  545                                  	;BLCK_L1:
  546                                  	;	 MOVE.L  D4,A2		 ;MOVE NEW LENGTH TO A2
  547                                  	;	 LSR.L	 #2,D4		 ;LET D4=LONG-WORD COUNT
  548                                  	;	 ADDQ.L  #1,D4		 ;
  549                                  	;	 BRA	 FILL_L 	 ;FILL 1st DATA
  550                                  	;BLCK_L2:
  551                                  	;	 LSR.L	 #2,D4		 ;LET D4=LONG-WORD COUNT
  552                                  	;	 ADDQ.L  #1,D4		 ;
  553                                  	;CNTFILL_L:
  554                                  	;	 SUBQ.L  #1,D4		 ;END OF COUNT ?
  555                                  	;	 BEQ	 LAST_L_BLCK	 ;YES, FILL LAST DATA
  556                                  	;	 MOVE.B  (A5)+,D1	 ;READ CURRENT DATA FROM CANNED BUFFER
  557                                  	;	 SUBQ.L  #1,D2		 ;COUNT-1
  558                                  	;	 BNE	 CNTF1_L
  559                                  	;	 MOVE.L  A0,A5		 ;SAVE START ADDRESS OF CANNED BUFFER
  560                                  	;	 MOVE.L  A3,D2		 ;INITIAL COUNT
  Thu Apr 20 1989 11:55                                                                                                  Page   11




  561                                  	;CNTF1_L:
  562                                  	;	 LSL.L	 #8,D1
  563                                  	;	 MOVE.B  (A5)+,D1	 ;READ CURRENT DATA FROM CANNED BUFFER
  564                                  	;	 SUBQ.L  #1,D2		 ;COUNT-1
  565                                  	;	 BNE	 CNTF2_L
  566                                  	;	 MOVE.L  A0,A5		 ;SAVE START ADDRESS OF CANNED BUFFER
  567                                  	;	 MOVE.L  A3,D2		 ;INITIAL COUNT
  568                                  	;CNTF2_L:
  569                                  	;	 LSL.L	 #8,D1
  570                                  	;	 MOVE.B  (A5)+,D1	 ;READ CURRENT DATA FROM CANNED BUFFER
  571                                  	;	 SUBQ.L  #1,D2		 ;COUNT-1
  572                                  	;	 BNE	 CNTF3_L
  573                                  	;	 MOVE.L  A0,A5		 ;SAVE START ADDRESS OF CANNED BUFFER
  574                                  	;	 MOVE.L  A3,D2		 ;INITIAL COUNT
  575                                  	;CNTF3_L:
  576                                  	;	 LSL.L	 #8,D1
  577                                  	;	 MOVE.B  (A5)+,D1	 ;READ CURRENT DATA FROM CANNED BUFFER
  578                                  	;	 SUBQ.L  #1,D2		 ;COUNT-1
  579                                  	;	 BNE	 FILL_L
  580                                  	;	 MOVE.L  A0,A5		 ;SAVE START ADDRESS OF CANNED BUFFER
  581                                  	;	 MOVE.L  A3,D2		 ;INITIAL COUNT
  582                                  	;FILL_L:
  583                                  	;	 MOVES.L D1,(A1)	 ;WRITE DATA TO MEMORY
  584                                  	;	 OR.L	 D6,D6		 ;NEED VERIFICATION ?
  585                                  	;	 BEQ	 BLCK1_L	 ;NO, DON'T READ BACK DATA
  586                                  	;	 MOVES.L (A1),D3	 ;READ BACK DATA
  587                                  	;	 CMP.L	 D1,D3		 ;WRITE CORRECT ?
  588                                  	;	 BNE	 RAMERR 	 ;NO, SET ERR. FLG
  589                                  	;BLCK1_L:
  590                                  	;	 ADDQ.L  #4,A1		 ;SRC ADDR + 1
  591                                  	;	 BRA	 CNTFILL_L	 ;COUNTINUE, IF COUNT NOT ZERO
  592                                  	;
  593                                  	;LAST_L_BLCK:
  594                                  	;	 MOVE.L  A2,D4		 ;MOVE RANGE LENGTH TO D4
  595                                  	;	 ANDI.L  #3,D4		 ;GET MOD(D4/4) TO D4
  596                                  	;LAST_FILL:
  597                                  	;	 BEQ	 STOP		 ; END JOB IF NO DATA REMAINDER
  598                                  	;	 MOVE.L  #4,D5		 ;SHIFT COUNT
  599                                  	;	 MOVES.L (A1),D3	 ;READ ALREADY EXIST DATA
  600                                  	;LAST_FILL1:
  601                                  	;	 LSL.L	 #8,D1		 ;SHIFT DATA ONE TIME
  602                                  	;	 ROL.L	 #8,D3		 ;MOVE MSB TO D1
  603                                  	;	 MOVE.B  D3,D1		 ;
  604                                  	;	 SUBQ.L  #1,D4		 ;END OF LAST DATA ?
  605                                  	;	 BMI	 LAST1		 ;YES, DON'T CHANG DATA
  606                                  	;	 MOVE.B  (A5)+,D1	 ;GET CURRENT DATA FROM CAN BUFFER
  607                                  	;	 SUBQ.L  #1,D2		 ;DATA COUNT-1
  608                                  	;	 BNE	 LAST1
  609                                  	;	 MOVE.L  A0,A5		 ;SAVE START ADDRESS OF CANNED BUFFER
  610                                  	;	 MOVE.L  A3,D2		 ;INITIAL COUNT
  611                                  	;LAST1:
  612                                  	;	 SUBQ.L  #1,D5		 ;4th TIME ?
  613                                  	;	 BNE	 LAST_FILL1	 ;NO, GET NEXT BYTE
  614                                  	;	 MOVES.L D1,(A1)	 ;PUT TO MEMORY
  615                                  	;	 OR.L	 D6,D6		 ;NEED VERIFICATION ?
  616                                  	;	 BEQ	 STOP		 ;NO, DON'T READ BACK DATA
  617                                  	;	 MOVES.L (A1),D3	 ;READ BACK DATA
  Thu Apr 20 1989 11:55                                                                                                  Page   12




  618                                  	;	 CMP.L	 D1,D3		 ;WRITE CORRECT ?
  619                                  	;	 BNE	 RAMERR 	 ;NO, SET ERR. FLG
  620                                  	;	 BRA	 STOP		 ;END OF BLOCK FDILL
  621                                  	;=======================================================deleted.
  622                                  	
  623                                  	;================================================================
  624                                  	; MEMORY COMPARE						=
  625                                  	; A1= Source Starting address					=
  626                                  	; A2= Source Endding address					=
  627                                  	; A3= Destination Starting address				=
  628                                  	; A4= Flg							=
  629                                  	; SFC Reg.= Src.						=
  630                                  	; DFC Reg.= Dst.						=
  631                                  	;================================================================
  632                                  	
  633                                  	;----------------------------------------------------------------
  634                                  	; Memory compare with BYTE format
  635                                  	;----------------------------------------------------------------
  636   000003EE                       	COMPARE_B:
  637   000003EE   4E7A 0000           		MOVEC	SFC,D0		;SAVE SFC TO D0
  638   000003F2   4E7A 1001           		MOVEC	DFC,D1		;SAVE DFC TO D1
  639   000003F6   2A49                		MOVE.L	A1,A5		;SAVE START ADDRESS TO A5
  640   000003F8                       	CMPDATA_B:
  641   000003F8   4E7B 0000           		MOVEC	D0,SFC		;SET SFC ACCORDING TO Src.
  642   000003FC   0E19 2000           		MOVES.B (A1)+,D2	;READ Src. CURRENT DATA TO D2
  643   00000400   4E7B 1000           		MOVEC	D1,SFC		;SET SFC ACCORDING TO Dst.
  644   00000404   0E1B 3000           		MOVES.B (A3)+,D3	;READ Dst. CURRENT DATA TO D3
  645   00000408   B602                		CMP.B	D2,D3		;Src DATA = Dst. DATA ?
  646   0000040A   66FF 0000 0088      		BNE	CMPERR_B	    ;NO, COMPARE ERROR
  647   00000410   B3CD                		CMP.L	A5,A1		;CURRENT ADDRESS < START ADDRESS ?
  648   00000412   65FF 0000 0008      		BCS	CMP_B_OK	    ;YES THEN END JOB
  649   00000418   B5C9                		CMP.L	A1,A2		;A1>A2 ?
  650   0000041A   64DC                		BCC	CMPDATA_B	    ;NO, COMPARE NEXT DATA
  651   0000041C                       	CMP_B_OK:
  652   0000041C   38BC 0000           		MOVE.W	#0,(A4) 	;SET COMPARE OK
  653   00000420   6000 FCFE           		BRA	STOP		;END COMPARE
  654                                  	;----------------------------------------------------------------
  655                                  	; Memory compare with WORD format
  656                                  	;----------------------------------------------------------------
  657   00000424                       	COMPARE_W:
  658   00000424   4E7A 0000           		MOVEC	SFC,D0		;SAVE SFC TO D0
  659   00000428   4E7A 1001           		MOVEC	DFC,D1		;SAVE DFC TO D1
  660   0000042C   2A49                		MOVE.L	A1,A5		;SAVE START ADDRESS TO A5
  661   0000042E                       	CMPDATA_W:
  662   0000042E   4E7B 0000           		MOVEC	D0,SFC		;SET SFC ACCORDING TO Src.
  663   00000432   0E59 2000           		MOVES.W (A1)+,D2	;READ Src. CURRENT DATA TO D2
  664   00000436   4E7B 1000           		MOVEC	D1,SFC		;SET SFC ACCORDING TO Dst.
  665   0000043A   0E5B 3000           		MOVES.W (A3)+,D3	;READ Dst. CURRENT DATA TO D3
  666   0000043E   B642                		CMP.W	D2,D3		;Src DATA = Dst. DATA ?
  667   00000440   66FF 0000 004E      		BNE	CMPERR_W	;NO, COMPARE ERROR
  668   00000446   B3CD                		CMP.L	A5,A1		;CURRENT ADDRESS < START ADDRESS ?
  669   00000448   65FF 0000 0008      		BCS	CMP_W_OK	;YES THEN END JOB
  670   0000044E   B5C9                		CMP.L	A1,A2		;A1>A2 ?
  671   00000450   64DC                		BCC	CMPDATA_W	;NO, COMPARE NEXT DATA
  672   00000452                       	CMP_W_OK:
  673   00000452   38BC 0000           		MOVE.W	#0,(A4) 	;SET COMPARE OK
  674   00000456   6000 FCC8           		BRA	STOP		;END COMPARE
  Thu Apr 20 1989 11:55                                                                                                  Page   13




  675                                  	;----------------------------------------------------------------
  676                                  	; Memory compare with LONG-WORD format
  677                                  	;----------------------------------------------------------------
  678   0000045A                       	COMPARE_L:
  679   0000045A   4E7A 0000           		MOVEC	SFC,D0		;SAVE SFC TO D0
  680   0000045E   4E7A 1001           		MOVEC	DFC,D1		;SAVE DFC TO D1
  681   00000462   2A49                		MOVE.L	A1,A5		;SAVE START ADDRESS TO A5
  682   00000464                       	CMPDATA_L:
  683   00000464   4E7B 0000           		MOVEC	D0,SFC		;SET SFC ACCORDING TO Src.
  684   00000468   0E99 2000           		MOVES.L (A1)+,D2	;READ Src. CURRENT DATA TO D2
  685   0000046C   4E7B 1000           		MOVEC	D1,SFC		;SET SFC ACCORDING TO Dst.
  686   00000470   0E9B 3000           		MOVES.L (A3)+,D3	;READ Dst. CURRENT DATA TO D3
  687   00000474   B682                		CMP.L	D2,D3		;Src DATA = Dst. DATA ?
  688   00000476   66FF 0000 0014      		BNE	CMPERR_L	;NO, COMPARE ERROR
  689   0000047C   B3CD                		CMP.L	A5,A1		;CURRENT ADDRESS < START ADDRESS ?
  690   0000047E   659C                		BCS	CMP_B_OK	;YES THEN END JOB
  691   00000480   B5C9                		CMP.L	A1,A2		;A1>A2 ?
  692   00000482   64E0                		BCC	CMPDATA_L	;NO, COMPARE NEXT DATA
  693   00000484                       	CMP_L_OK:
  694   00000484   38BC 0000           		MOVE.W	#0,(A4) 	;SET COMPARE OK
  695   00000488   6000 FC96           		BRA	STOP		;END COMPARE
  696                                  	;----------------------------------------------------------------
  697   0000048C                       	CMPERR_L:
  698   0000048C   5589                		SUBQ.L	#2,A1		;LET A1=A1-2-1-1 AND A3=A3-2-1-1
  699   0000048E   558B                		SUBQ.L	#2,A3		;LET A3=A3-2-1-1 AND A3=A3-2-1-1
  700   00000490                       	CMPERR_W:
  701   00000490   5389                		SUBQ.L	#1,A1		;LET A1=A1-1-1 AND A3=A3-1-1
  702   00000492   538B                		SUBQ.L	#1,A3		;LET A3=A3-1-1 AND A3=A3-1-1
  703   00000494                       	CMPERR_B:
  704   00000494   5389                		SUBQ.L	#1,A1		;LET A1=A1-1 AND A3=A3-1
  705   00000496   538B                		SUBQ.L	#1,A3		;LET A3=A3-1 AND A3=A3-1
  706   00000498   38BC FF00           	CMPERR: MOVE.W	#0FF00H,(A4)	;SET ERR FLG
  707   0000049C   20C9                		MOVE.L	A1,(A0)+	;SAVE SRC. ADDDR
  708   0000049E   20C2                		MOVE.L	D2,(A0)+	;SAVE SRC DATA
  709   000004A0   20CB                		MOVE.L	A3,(A0)+	;SAVE DST. ADDR
  710   000004A2   20C3                		MOVE.L	D3,(A0)+	;SAVE DST. DATA
  711   000004A4   6000 FC7A           		BRA	STOP		;END FLG SETTING
  712                                  	
  713                                  	;================================================================
  714                                  	; MEMORY MOVE - FORWARD TRANSFER :				=
  715                                  	; A1= Source Starting address					=
  716                                  	; A2= Source Endding address					=
  717                                  	; A3= Destination Starting address				=
  718                                  	; A4= Flg							=
  719                                  	; SFC Reg.= Src.						=
  720                                  	; DFC Reg.= Dst.						=
  721                                  	; D6= Verify flg						=
  722                                  	;================================================================
  723                                  	
  724                                  	;----------------------------------------------------------------
  725                                  	; Forward transfer with byte format
  726                                  	;----------------------------------------------------------------
  727   000004A8                       	FRWD_B_MOV:
  728   000004A8   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  729   000004B0   4E7A 0000           		MOVEC	SFC,D0		;SAVE SFC
  730   000004B4   4E7A 1001           		MOVEC	DFC,D1		;SAVE DFC
  731   000004B8                       	FRWD_B_NXT:
  Thu Apr 20 1989 11:55                                                                                                  Page   14




  732   000004B8   4E7B 0000           		MOVEC	D0,SFC		;SET SFC ACCORDING TO Src.
  733   000004BC   0E19 2000           		MOVES.B (A1)+,D2	;READ SRC. CURRENT DATA
  734   000004C0   0E13 2800           		MOVES.B D2,(A3) 	;SAVE DATA TO DST
  735   000004C4   8C46                		OR	D6,D6		;NEED VERIFICATION
  736   000004C6   67FF 0000 0010      		BEQ	FRWD1_B 	;NO,DON'T READ BACK DATA
  737   000004CC   4E7B 1000           		MOVEC	D1,SFC		;SET SFC ACCORDING TO Dst.
  738   000004D0   0E13 3000           		MOVES.B (A3),D3 	;READ BACK DATA JUST WRITTEN
  739   000004D4   B602                		CMP.B	D2,D3		;WRITE CORRECT ?
  740   000004D6   66C0                		BNE	CMPERR		;NO, SET ERROR FLG
  741   000004D8                       	FRWD1_B:
  742   000004D8   528B                		ADDQ.L	#1,A3		;DST ADDR + 1
  743   000004DA   B5C9                		CMP.L	A1,A2		;A2>A1 ?
  744   000004DC   64DA                		BCC	FRWD_B_NXT	;YES, CONTINUE MOVE
  745   000004DE   6000 FC40           		BRA	STOP		;NO, END MOVE
  746                                  	;----------------------------------------------------------------
  747                                  	; Forward transfer with WORD format
  748                                  	;----------------------------------------------------------------
  749   000004E2                       	FRWD_W_MOV:
  750   000004E2   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  751   000004EA   4E7A 0000           		MOVEC	SFC,D0		;SAVE SFC
  752   000004EE   4E7A 1001           		MOVEC	DFC,D1		;SAVE DFC
  753   000004F2                       	FRWD_W_NXT:
  754   000004F2   4E7B 0000           		MOVEC	D0,SFC		;SET SFC ACCORDING TO Src.
  755   000004F6   0E59 2000           		MOVES.W (A1)+,D2	;READ SRC. CURRENT DATA
  756   000004FA   0E53 2800           		MOVES.W D2,(A3) 	;SAVE DATA TO DST
  757   000004FE   8C46                		OR	D6,D6		;NEED VERIFICATION
  758   00000500   67FF 0000 0010      		BEQ	FRWD1_W 	;NO,DON'T READ BACK DATA
  759   00000506   4E7B 1000           		MOVEC	D1,SFC		;SET SFC ACCORDING TO Dst.
  760   0000050A   0E53 3000           		MOVES.W (A3),D3 	;READ BACK DATA JUST WRITTEN
  761   0000050E   B642                		CMP.W	D2,D3		;WRITE CORRECT ?
  762   00000510   6686                		BNE	CMPERR		;NO, SET ERROR FLG
  763   00000512                       	FRWD1_W:
  764   00000512   548B                		ADDQ.L	#2,A3		;DST ADDR + 1
  765   00000514   B5C9                		CMP.L	A1,A2		;A2>A1 ?
  766   00000516   64DA                		BCC	FRWD_W_NXT	;YES, CONTINUE MOVE
  767   00000518   6000 FC06           		BRA	STOP		;NO, END MOVE
  768                                  	;----------------------------------------------------------------
  769                                  	; Forward transfer with long format
  770                                  	;----------------------------------------------------------------
  771   0000051C                       	FRWD_L_MOV:
  772   0000051C   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  773   00000524   4E7A 0000           		MOVEC	SFC,D0		;SAVE SFC
  774   00000528   4E7A 1001           		MOVEC	DFC,D1		;SAVE DFC
  775   0000052C                       	FRWD_L_NXT:
  776   0000052C   4E7B 0000           		MOVEC	D0,SFC		;SET SFC ACCORDING TO Src.
  777   00000530   0E99 2000           		MOVES.L (A1)+,D2	;READ SRC. CURRENT DATA
  778   00000534   0E93 2800           		MOVES.L D2,(A3) 	;SAVE DATA TO DST
  779   00000538   8C46                		OR	D6,D6		;NEED VERIFICATION
  780   0000053A   67FF 0000 0012      		BEQ	FRWD1_L 	;NO,DON'T READ BACK DATA
  781   00000540   4E7B 1000           		MOVEC	D1,SFC		;SET SFC ACCORDING TO Dst.
  782   00000544   0E13 3000           		MOVES.B (A3),D3 	;READ BACK DATA JUST WRITTEN
  783   00000548   B602                		CMP.B	D2,D3		;WRITE CORRECT ?
  784   0000054A   6600 FF4C           		BNE	CMPERR		;NO, SET ERROR FLG
  785   0000054E                       	FRWD1_L:
  786   0000054E   588B                		ADDQ.L	#4,A3		;DST ADDR + 1
  787   00000550   B5C9                		CMP.L	A1,A2		;A2>A1 ?
  788   00000552   64D8                		BCC	FRWD_L_NXT	;YES, CONTINUE MOVE
  Thu Apr 20 1989 11:55                                                                                                  Page   15




  789   00000554   6000 FBCA           		BRA	STOP		;NO, END MOVE
  790                                  	;================================================================
  791                                  	; MEMORY MOVE - BACKWARD TRANSFER :				=
  792                                  	; A1= Source Starting address					=
  793                                  	; A2= Source Endding address					=
  794                                  	; A3= Destination Starting address				=
  795                                  	; A4= Flg							=
  796                                  	; SFC Reg.= Src.						=
  797                                  	; DFC Reg.= Dst.						=
  798                                  	; D6= Verify flg						=
  799                                  	;================================================================
  800                                  	
  801                                  	;----------------------------------------------------------------
  802                                  	; Backward transfer with BYTE format
  803                                  	;----------------------------------------------------------------
  804   00000558                       	BKRD_B_MOV:
  805   00000558   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  806   00000560   4E7A 0000           		MOVEC	SFC,D0		;SAVE SFC
  807   00000564   4E7A 1001           		MOVEC	DFC,D1		;SAVE DFC
  808   00000568   260A                		MOVE.L	A2,D3		;MOVE A2 TO D3
  809   0000056A   9689                		SUB.L	A1,D3		;GET MOVE LENTH
  810   0000056C   D7C3                		ADDA.L	D3,A3		;DETERMINE LAST DST-ADDRESS
  811   0000056E   528A                		ADDQ.L	#1,A2
  812   00000570   528B                		ADDQ.L	#1,A3
  813   00000572                       	BKWD_B_NXT:
  814   00000572   4E7B 0000           		MOVEC	D0,SFC		;SET SFC ACCORDING TO Src.
  815   00000576   0E22 3000           		MOVES.B -(A2),D3	;READ SRC. CURRENT DATA
  816   0000057A   0E23 3800           		MOVES.B D3,-(A3)		;SAVE DATA TO DST
  817   0000057E   8C46                		OR	D6,D6		;NEED VERIFICATION
  818   00000580   67FF 0000 000E      		BEQ	BKWD1_B 	;NO,DON'T READ BACK DATA
  819   00000586   4E7B 1000           		MOVEC	D1,SFC		;SET SFC ACCORDING TO Dst.
  820   0000058A   0E13 2000           		MOVES.B (A3),D2 	;READ BACK DATA JUST WRITTEN
  821   0000058E   B602                		CMP.B	D2,D3		;WRITE CORRECT ?
  822   00000590                       	BKWD1_B:
  823   00000590   6600 FF06           		BNE	CMPERR		;NO, SET ERROR FLG
  824   00000594   B5C9                		CMP.L	A1,A2		;A2>A1 ?
  825   00000596   62DA                		BHI	BKWD_B_NXT	;YES,CONTINUE MOVE
  826   00000598   6000 FB86           		BRA	STOP		;NO, END MOVE
  827                                  	;----------------------------------------------------------------
  828                                  	; Backward transfer with WORD format
  829                                  	;----------------------------------------------------------------
  830   0000059C                       	BKRD_W_MOV:
  831   0000059C   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  832   000005A4   4E7A 0000           		MOVEC	SFC,D0		;SAVE SFC
  833   000005A8   4E7A 1001           		MOVEC	DFC,D1		;SAVE DFC
  834   000005AC   260A                		MOVE.L	A2,D3		;MOVE A2 TO D3
  835   000005AE   9689                		SUB.L	A1,D3		;GET MOVE LENTH
  836   000005B0   D7C3                		ADDA.L	D3,A3		;DETERMINE LAST DST-ADDRESS
  837   000005B2   548A                		ADDQ.L	#2,A2
  838   000005B4   548B                		ADDQ.L	#2,A3
  839   000005B6                       	BKWD_W_NXT:
  840   000005B6   4E7B 0000           		MOVEC	D0,SFC		;SET SFC ACCORDING TO Src.
  841   000005BA   0E62 3000           		MOVES.W -(A2),D3	;READ SRC. CURRENT DATA
  842   000005BE   0E63 3800           		MOVES.W D3,-(A3)		;SAVE DATA TO DST
  843   000005C2   8C46                		OR	D6,D6		;NEED VERIFICATION
  844   000005C4   67FF 0000 000E      		BEQ	BKWD1_W 	;NO,DON'T READ BACK DATA
  845   000005CA   4E7B 1000           		MOVEC	D1,SFC		;SET SFC ACCORDING TO Dst.
  Thu Apr 20 1989 11:55                                                                                                  Page   16




  846   000005CE   0E53 2000           		MOVES.W (A3),D2 	;READ BACK DATA JUST WRITTEN
  847   000005D2   B642                		CMP.W	D2,D3		;WRITE CORRECT ?
  848   000005D4                       	BKWD1_W:
  849   000005D4   6600 FEC2           		BNE	CMPERR		;NO, SET ERROR FLG
  850   000005D8   B5C9                		CMP.L	A1,A2		;A2>A1 ?
  851   000005DA   62DA                		BHI	BKWD_W_NXT	;YES,CONTINUE MOVE
  852   000005DC   6000 FB42           		BRA	STOP		;NO, END MOVE
  853                                  	;----------------------------------------------------------------
  854                                  	; Backward transfer with LONG-WORD format
  855                                  	;----------------------------------------------------------------
  856   000005E0                       	BKRD_L_MOV:
  857   000005E0   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  858   000005E8   4E7A 0000           		MOVEC	SFC,D0		;SAVE SFC
  859   000005EC   4E7A 1001           		MOVEC	DFC,D1		;SAVE DFC
  860   000005F0   260A                		MOVE.L	A2,D3		;MOVE A2 TO D3
  861   000005F2   9689                		SUB.L	A1,D3		;GET MOVE LENTH
  862   000005F4   D7C3                		ADDA.L	D3,A3		;DETERMINE LAST DST-ADDRESS
  863   000005F6   588A                		ADDQ.L	#4,A2
  864   000005F8   588B                		ADDQ.L	#4,A3
  865   000005FA                       	BKWD_L_NXT:
  866   000005FA   4E7B 0000           		MOVEC	D0,SFC		;SET SFC ACCORDING TO Src.
  867   000005FE   0EA2 3000           		MOVES.L -(A2),D3	;READ SRC. CURRENT DATA
  868   00000602   0EA3 3800           		MOVES.L D3,-(A3)		;SAVE DATA TO DST
  869   00000606   8C46                		OR	D6,D6		;NEED VERIFICATION
  870   00000608   67FF 0000 000E      		BEQ	BKWD1_L 	;NO,DON'T READ BACK DATA
  871   0000060E   4E7B 1000           		MOVEC	D1,SFC		;SET SFC ACCORDING TO Dst.
  872   00000612   0E93 2000           		MOVES.L (A3),D2 	;READ BACK DATA JUST WRITTEN
  873   00000616   B682                		CMP.L	D2,D3		;WRITE CORRECT ?
  874   00000618                       	BKWD1_L:
  875   00000618   6600 FE7E           		BNE	CMPERR		;NO, SET ERROR FLG
  876   0000061C   B5C9                		CMP.L	A1,A2		;A2>=A1 ?
  877   0000061E   62DA                		BHI	BKWD_L_NXT	;YES,CONTINUE MOVE
  878   00000620   6000 FAFE           		BRA	STOP		;NO, END MOVE
  879                                  	;================================================================
  880                                  	; MEMORY CHECKSUM:						=
  881                                  	; A0= Canned buffer start address				=
  882                                  	; A1= Source start address					=
  883                                  	; A2= Source end address					=
  884                                  	;================================================================
  885                                  	
  886                                  	;----------------------------------------------------------------
  887                                  	; Checksum with BYTE format
  888                                  	;----------------------------------------------------------------
  889   00000624                       	CHECKSUM_B:
  890   00000624   B100                		EOR.B	D0,D0		;CLEAR BOTH CARRY AND D0
  891   00000626   2649                		MOVE.L	A1,A3		;SAVE START ADDRESS TO A3
  892   00000628                       	CNTADD_B:
  893   00000628   0E19 1000           		MOVES.B (A1)+,D1	;READ CURRENT DATA
  894   0000062C   D101                		ADDX.B	D1,D0		;ADDED TO D0 WITH CARRY
  895   0000062E   B3CB                		CMP.L	A3,A1		;CURRENT ADDRESS < START ADDRESS ?
  896   00000630   65FF 0000 0008      		BCS	SAVE_B_CKSUM	;YES THEN END JOB
  897   00000636   B5C9                		CMP.L	A1,A2		;A1>A2 ?
  898   00000638   64EE                		BCC	CNTADD_B	;NO, CONTINUE
  899   0000063A                       	SAVE_B_CKSUM:
  900   0000063A   7200                	    moveq   #0,d1	;		yeh: 1/12/89
  901   0000063C   D101                	    addx.b  d1,d0	;add last carry yeh: 1/12/89
  902   0000063E   E148                		LSL.W	#8,D0		;SHIFT CHECKSUM TO HIGH BYTE
  Thu Apr 20 1989 11:55                                                                                                  Page   17




  903   00000640   3080                		MOVE.W	D0,(A0) 	;SAVE CHECKSUM
  904   00000642   6000 FADC           		BRA	STOP		;END CHECKSUM JOB
  905                                  	;----------------------------------------------------------------
  906                                  	; Checksum with WORD format
  907                                  	;----------------------------------------------------------------
  908   00000646                       	CHECKSUM_W:
  909   00000646   B140                		EOR.W	D0,D0		;CLEAR BOTH CARRY AND D0
  910   00000648   2649                		MOVE.L	A1,A3		;SAVE START ADDRESS TO A3
  911   0000064A                       	CNTADD_W:
  912   0000064A   0E59 1000           		MOVES.W (A1)+,D1	;READ CURRENT DATA
  913   0000064E   D141                		ADDX.W	D1,D0		;ADDED TO D0 WITH CARRY
  914   00000650   B3CB                		CMP.L	A3,A1		;CURRENT ADDRESS < START ADDRESS ?
  915   00000652   65FF 0000 0008      		BCS	SAVE_W_CKSUM	;YES THEN END JOB
  916   00000658   B5C9                		CMP.L	A1,A2		;A1>A2 ?
  917   0000065A   64EE                		BCC	CNTADD_W	;NO, CONTINUE
  918   0000065C                       	SAVE_W_CKSUM:
  919   0000065C   7200                	    moveq   #0,d1	;		yeh: 1/12/89
  920   0000065E   D141                	    addx.w  d1,d0	;add last carry yeh: 1/12/89
  921   00000660   3080                		MOVE.W	D0,(A0) 	;SAVE CHECKSUM
  922   00000662   6000 FABC           		BRA	STOP
  923                                  	;----------------------------------------------------------------
  924                                  	; Checksum with LONG-WORD format
  925                                  	;----------------------------------------------------------------
  926   00000666                       	CHECKSUM_L:
  927   00000666   B180                		EOR.L	D0,D0		;CLEAR BOTH CARRY AND D0
  928   00000668   2649                		MOVE.L	A1,A3		;SAVE START ADDRESS TO A3
  929   0000066A                       	CNTADD_L:
  930   0000066A   0E99 1000           		MOVES.L (A1)+,D1	;READ CURRENT DATA
  931   0000066E   D181                		ADDX.L	D1,D0		;ADDED TO D0 WITH CARRY
  932   00000670   B3CB                		CMP.L	A3,A1		;CURRENT ADDRESS < START ADDRESS ?
  933   00000672   65FF 0000 0008      		BCS	SAVE_L_CKSUM	;YES THEN END JOB
  934   00000678   B5C9                		CMP.L	A1,A2		;A1>A2 ?
  935   0000067A   64EE                		BCC	CNTADD_L	;NO, CONTINUE
  936   0000067C                       	SAVE_L_CKSUM:
  937   0000067C   7200                	    moveq   #0,d1	;		yeh: 1/12/89
  938   0000067E   D181                	    addx.l  d1,d0	;add last carry yeh: 1/12/89
  939   00000680   2080                		MOVE.L	D0,(A0) 	;SAVE CHECKSUM
  940   00000682   6000 FA9C           		BRA	STOP
  941                                  	
  942                                  	;================================================================
  943                                  	; RAM TEST							=
  944                                  	; A0 : Can_buffer starting address				=
  945                                  	; A1 : RAM test starting addrss 				=
  946                                  	; A2 : RAM test endding address 				=
  947                                  	; D6 : memory verify flag					-
  948                                  	;================================================================
  949                                  	
  950                                  	;================================================================
  951                                  	; RAM test with BYTE format					=
  952                                  	;================================================================
  953   00000686                       	RAM_B_TEST:
  954   00000686   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
  955   0000068E   2A49                		MOVE.L	A1,A5		;SAVE STARTING ADDRESS
  956   00000690   2649                		MOVE.L	A1,A3		;SAVE START ADDRESS TO A3
  957   00000692                       	RAM_B_T0:
  958   00000692   2009                		MOVE.L	A1,D0		;MOVE STARTING ADDR TO D0
  959   00000694   2200                		MOVE.L	D0,D1		;MOVE STARTING ADDR TO D1
  Thu Apr 20 1989 11:55                                                                                                  Page   18




  960   00000696   183C 0003           		MOVE.B	#3,D4		;INTIAL XOR COUNT
  961   0000069A                       	RAM_B_T2:
  962   0000069A   E199                		ROL.L	#8,D1		;ROTATE D0 8 BITS
  963   0000069C   B300                		EOR.B	D1,D0		;D0 EXCUSIVE OR D1 WITH WORD
  964   0000069E   5304                		SUBQ.B	#1,D4		;DOWN COUNT XOR COUNTER
  965   000006A0   66F8                		BNE	RAM_B_T2	;COUNTINUE IF NO MATCH 4 TIMES
  966   000006A2   0E11 0800           		MOVES.B D0,(A1) 	;WRITE D0 TO MEMORY
  967   000006A6   0E11 1000           		MOVES.B (A1),D1 	;READ MEMORY TO D1
  968   000006AA   B200                		CMP.B	D0,D1		;COMPARE D0 AND D1
  969   000006AC   66FF 0000 0198      		BNE	RAMERR		;NOT EQUAL THEN RAM_ERROR
  970   000006B2   4600                		NOT.B	D0		;1'S COMPLEMENT OF D0
  971   000006B4   0E11 0800           		MOVES.B D0,(A1) 	;WRITE D0 TO MEMORY
  972   000006B8   0E19 1000           		MOVES.B (A1)+,D1	;READ MEMORY TO D1
  973   000006BC   B200                		CMP.B	D0,D1		;COMPARE D0 AND D1
  974   000006BE   66FF 0000 0184      		BNE	TSTERR_B	;NOT EQUAL THEN RAM_ERROR
  975   000006C4   B3CB                		CMP.L	A3,A1		;CURRENT ADDRESS < START ADDRESS ?
  976   000006C6   65FF 0000 0008      		BCS	PASS_B		;YES THEN PASS 2 TEST
  977   000006CC   B5C9                		CMP.L	A1,A2		;IS END ADDRESS ?
  978   000006CE   64C2                		BCC	RAM_B_T0	;NOT END,CONTINUE
  979   000006D0                       	PASS_B:
  980   000006D0   224D                		MOVE.L	A5,A1		;RESTORE STARTING ADDR TO A1
  981   000006D2                       	RAM_B_T1:
  982   000006D2   2009                		MOVE.L	A1,D0		;MOVE STARTING ADDR TO D0
  983   000006D4   2200                		MOVE.L	D0,D1		;MOVE STARTING ADDR TO D1
  984   000006D6   183C 0003           		MOVE.B	#3,D4		;INTIAL XOR COUNT
  985   000006DA                       	RAM_B_T3:
  986   000006DA   E199                		ROL.L	#8,D1		;ROTATE D0 8 BITS
  987   000006DC   B300                		EOR.B	D1,D0		;D0 EXCUSIVE OR D1 WITH WORD
  988   000006DE   5304                		SUBQ.B	#1,D4		;END 4 TIMES ?
  989   000006E0   66F8                		BNE	RAM_B_T3	;NO, COUNTINUE EXCLUSIVE DATA
  990   000006E2   4600                		NOT.B	D0		;1'S COMPLEMENT OF D0
  991   000006E4   0E19 1000           		MOVES.B (A1)+,D1	;READ MEMORY TO D1
  992   000006E8   B200                		CMP.B	D0,D1		;COMPARE D0 AND D1
  993   000006EA   66FF 0000 0158      		BNE	TSTERR_B	;NOT EQUAL THEN RAM_ERROR
  994   000006F0   B3CD                		CMP.L	A5,A1		;CURRENT ADDRESS < START ADDRESS ?
  995   000006F2   6500 FA2C           		BCS	STOP		;YES THEN END JOB
  996   000006F6   B5C9                		CMP.L	A1,A2		;IS END ADDRESS ?
  997   000006F8   6500 FA26           		BCS	STOP		;YES THEN END JOB
  998   000006FC   64D4                		BCC	RAM_B_T1	;NOT END,CONTINUE
  999   000006FE   6000 FA20           		BRA	STOP		;END,JMP TO CAN END
 1000                                  	;================================================================
 1001                                  	; RAM test with WORD format					=
 1002                                  	;================================================================
 1003   00000702                       	RAM_W_TEST:
 1004   00000702   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
 1005   0000070A   2A49                		MOVE.L	A1,A5		;SAVE STARTING ADDRESS
 1006   0000070C                       	RAM_W_T0:
 1007   0000070C   2009                		MOVE.L	A1,D0		;MOVE STARTING ADDR TO D0
 1008   0000070E   2200                		MOVE.L	D0,D1		;MOVE STARTING ADDR TO D1
 1009   00000710   7400                		MOVE.L	#0,D2		;INITIAL EXCLUSIVE OR DATA
 1010   00000712   1A3C 0002           		MOVE.B	#2,D5		;WORD FORMAT
 1011   00000716                       	RAM_W_T2:
 1012   00000716   183C 0003           		MOVE.B	#3,D4		;INITIAL EXCLUSIVE COUNT
 1013   0000071A   2001                		MOVE.L	D1,D0		;MOV D1 TO D0
 1014   0000071C                       	RAM_W_T3:
 1015   0000071C   E099                		ROR.L	#8,D1		;ROTE ADDRESS 8 BITS
 1016   0000071E   B300                		EOR.B	D1,D0		;EXCLUSIVE DATA
  Thu Apr 20 1989 11:55                                                                                                  Page   19




 1017   00000720   5304                		SUBQ.B	#1,D4		;END 4 TIMES ?
 1018   00000722   66F8                		BNE	RAM_W_T3	;NO, COUNTINUE EXCLUSIVE DATA
 1019   00000724   E099                		ROR.L	#8,D1		;ROTE ONE BYTE
 1020   00000726   E18A                		LSL.L	#8,D2		;SHIFT D2 ONE BYTE
 1021   00000728   8400                		OR.B	D0,D2		;COMBINE DATA
 1022   0000072A   5281                		ADDQ.L	#1,D1		;ADDRESS-1
 1023   0000072C   5305                		SUBQ.B	#1,D5		;END WORD OPERATION ?
 1024   0000072E   66E6                		BNE	RAM_W_T2	;NO, NEXT ADDRESS
 1025   00000730   0E51 2800           		MOVES.W D2,(A1) 	;WRITE D2 TO MEMORY
 1026   00000734   0E51 1000           		MOVES.W (A1),D1 	;READ MEMORY TO D1
 1027   00000738   B242                		CMP.W	D2,D1		;COMPARE D2 AND D1
 1028   0000073A   66FF 0000 010A      		BNE	RAMERR		;NOT EQUAL THEN RAM_ERROR
 1029   00000740   4642                		NOT.W	D2		;1'S COMPLEMENT OF D2
 1030   00000742   0E51 2800           		MOVES.W D2,(A1) 	;WRITE D2 TO MEMORY
 1031   00000746   0E59 1000           		MOVES.W (A1)+,D1	;READ MEMORY TO D1
 1032   0000074A   B242                		CMP.W	D2,D1		;COMPARE D2 AND D1
 1033   0000074C   66FF 0000 00F4      		BNE	TSTERR_W	;NOT EQUAL THEN RAM_ERROR
 1034   00000752   B3CD                		CMP.L	A5,A1		;CURRENT ADDRESS < START ADDRESS ?
 1035   00000754   65FF 0000 0008      		BCS	PASS_W		;YES THEN PASS 2 TEST
 1036   0000075A   B5C9                		CMP.L	A1,A2		;IS END ADDRESS ?
 1037   0000075C   64AE                		BCC	RAM_W_T0	;NOT END,CONTINUE
 1038   0000075E                       	PASS_W:
 1039   0000075E   224D                		MOVE.L	A5,A1		;RESTORE STARTING ADDR TO A1
 1040   00000760                       	RAM_W_T1:
 1041   00000760   2009                		MOVE.L	A1,D0		;MOVE STARTING ADDR TO D0
 1042   00000762   2200                		MOVE.L	D0,D1		;MOVE STARTING ADDR TO D1
 1043   00000764   7400                		MOVE.L	#0,D2		;INITIAL EXCLUSIVE OR DATA
 1044   00000766   1A3C 0002           		MOVE.B	#2,D5		;WORD FORMAT
 1045   0000076A                       	RAM_W_T4:
 1046   0000076A   183C 0003           		MOVE.B	#3,D4		;INITIAL EXCLUSIVE COUNT
 1047   0000076E   2001                		MOVE.L	D1,D0		;MOV D1 TO D0
 1048   00000770                       	RAM_W_T5:
 1049   00000770   E099                		ROR.L	#8,D1		;ROTE ADDRESS 8 BITS
 1050   00000772   B300                		EOR.B	D1,D0		;EXCLUSIVE DATA
 1051   00000774   5304                		SUBQ.B	#1,D4		;END 4 TIMES ?
 1052   00000776   66F8                		BNE	RAM_W_T5	;NO, COUNTINUE EXCLUSIVE DATA
 1053   00000778   E099                		ROR.L	#8,D1		;ROTE ONE BYTE
 1054   0000077A   E18A                		LSL.L	#8,D2		;SHIFT D2 ONE BYTE
 1055   0000077C   8400                		OR.B	D0,D2		;COMBINE DATA
 1056   0000077E   5281                		ADDQ.L	#1,D1		;ADDRESS-1
 1057   00000780   5305                		SUBQ.B	#1,D5		;END WORD OPERATION ?
 1058   00000782   66E6                		BNE	RAM_W_T4	;NO, NEXT ADDRESS
 1059   00000784   4682                		NOT.L	D2		;1'S COMPLEMENT OF D0
 1060   00000786   0E59 1000           		MOVES.W (A1)+,D1	;READ MEMORY TO D1
 1061   0000078A   B242                		CMP.W	D2,D1		;COMPARE D0 AND D1
 1062   0000078C   66FF 0000 00B4      		BNE	TSTERR_W	;NOT EQUAL THEN RAM_ERROR
 1063   00000792   B3CD                		CMP.L	A5,A1		;CURRENT ADDRESS < START ADDRESS ?
 1064   00000794   6500 F98A           		BCS	STOP		;YES THEN END JOB
 1065   00000798   B5C9                		CMP.L	A1,A2		;IS END ADDRESS ?
 1066   0000079A   64C4                		BCC	RAM_W_T1	;NOT END,CONTINUE
 1067   0000079C   6000 F982           		BRA	STOP		;END,JMP TO CAN END
 1068                                  	;================================================================
 1069                                  	; RAM test with LONG-WORD format				=
 1070                                  	;================================================================
 1071   000007A0                       	RAM_L_TEST:
 1072   000007A0   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
 1073   000007A8   2A49                		MOVE.L	A1,A5		;SAVE STARTING ADDRESS
  Thu Apr 20 1989 11:55                                                                                                  Page   20




 1074   000007AA   2649                		MOVE.L	A1,A3		;SAVE START ADDRESS TO A3
 1075   000007AC                       	RAM_L_T0:
 1076   000007AC   2009                		MOVE.L	A1,D0		;MOVE STARTING ADDR TO D0
 1077   000007AE   2200                		MOVE.L	D0,D1		;MOVE STARTING ADDR TO D1
 1078   000007B0   7400                		MOVE.L	#0,D2		;INITIAL EXCLUSIVE OR DATA
 1079   000007B2   1A3C 0004           		MOVE.B	#4,D5		;LONG-WORD FORMAT
 1080   000007B6                       	RAM_L_T2:
 1081   000007B6   183C 0003           		MOVE.B	#3,D4		;INITIAL EXCLUSIVE COUNT
 1082   000007BA   2001                		MOVE.L	D1,D0		;MOV D1 TO D0
 1083   000007BC                       	RAM_L_T3:
 1084   000007BC   E099                		ROR.L	#8,D1		;ROTE ADDRESS 8 BITS
 1085   000007BE   B300                		EOR.B	D1,D0		;EXCLUSIVE DATA
 1086   000007C0   5304                		SUBQ.B	#1,D4		;END 4 TIMES ?
 1087   000007C2   66F8                		BNE	RAM_L_T3	;NO, COUNTINUE EXCLUSIVE DATA
 1088   000007C4   E099                		ROR.L	#8,D1		;ROTE ONE BYTE
 1089   000007C6   E18A                		LSL.L	#8,D2		;SHIFT D2 ONE BYTE
 1090   000007C8   8400                		OR.B	D0,D2		;COMBINE DATA
 1091   000007CA   5281                		ADDQ.L	#1,D1		;ADDRESS-1
 1092   000007CC   5305                		SUBQ.B	#1,D5		;END LONG-WORD OPERATION ?
 1093   000007CE   66E6                		BNE	RAM_L_T2	;NO, NEXT ADDRESS
 1094   000007D0   0E91 2800           		MOVES.L D2,(A1) 	;WRITE D2 TO MEMORY
 1095   000007D4   0E91 1000           		MOVES.L (A1),D1 	;READ MEMORY TO D1
 1096   000007D8   B282                		CMP.L	D2,D1		;COMPARE D2 AND D1
 1097   000007DA   66FF 0000 006A      		BNE	RAMERR		;NOT EQUAL THEN RAM_ERROR
 1098   000007E0   4682                		NOT.L	D2		;1'S COMPLEMENT OF D0
 1099   000007E2   0E91 2800           		MOVES.L D2,(A1) 	;WRITE D2 TO MEMORY
 1100   000007E6   0E99 1000           		MOVES.L (A1)+,D1	;READ MEMORY TO D1
 1101   000007EA   B282                		CMP.L	D2,D1		;COMPARE D0 AND D1
 1102   000007EC   66FF 0000 0052      		BNE	TSTERR_L	;NOT EQUAL THEN RAM_ERROR
 1103   000007F2   B3CD                		CMP.L	A5,A1		;CURRENT ADDRESS < START ADDRESS ?
 1104   000007F4   65FF 0000 0008      		BCS	PASS_L		;YES THEN PASS 2 TEST
 1105   000007FA   B5C9                		CMP.L	A1,A2		;IS END ADDRESS ?
 1106   000007FC   64AE                		BCC	RAM_L_T0	;NOT END,CONTINUE
 1107   000007FE                       	PASS_L:
 1108   000007FE   224D                		MOVE.L	A5,A1		;RESTORE STARTING ADDR TO A1
 1109   00000800                       	RAM_L_T1:
 1110   00000800   2009                		MOVE.L	A1,D0		;MOVE STARTING ADDR TO D0
 1111   00000802   2200                		MOVE.L	D0,D1		;MOVE STARTING ADDR TO D1
 1112   00000804   7400                		MOVE.L	#0,D2		;INITIAL EXCLUSIVE OR DATA
 1113   00000806   1A3C 0004           		MOVE.B	#4,D5		;LONG-WORD FORMAT
 1114   0000080A                       	RAM_L_T4:
 1115   0000080A   183C 0003           		MOVE.B	#3,D4		;INITIAL EXCLUSIVE COUNT
 1116   0000080E   2001                		MOVE.L	D1,D0		;MOV D1 TO D0
 1117   00000810                       	RAM_L_T5:
 1118   00000810   E099                		ROR.L	#8,D1		;ROTE ADDRESS 8 BITS
 1119   00000812   B300                		EOR.B	D1,D0		;EXCLUSIVE DATA
 1120   00000814   5304                		SUBQ.B	#1,D4		;END 4 TIMES ?
 1121   00000816   66F8                		BNE	RAM_L_T5	;NO, COUNTINUE EXCLUSIVE DATA
 1122   00000818   E099                		ROR.L	#8,D1		;ROTE ONE BYTE
 1123   0000081A   E18A                		LSL.L	#8,D2		;SHIFT D2 ONE BYTE
 1124   0000081C   8400                		OR.B	D0,D2		;COMBINE DATA
 1125   0000081E   5281                		ADDQ.L	#1,D1		;ADDRESS-1
 1126   00000820   5305                		SUBQ.B	#1,D5		;END WORD OPERATION ?
 1127   00000822   66E6                		BNE	RAM_L_T4	;NO, NEXT ADDRESS
 1128   00000824   4682                		NOT.L	D2		;1'S COMPLEMENT OF D0
 1129   00000826   0E99 1000           		MOVES.L (A1)+,D1	;READ MEMORY TO D1
 1130   0000082A   B282                		CMP.L	D2,D1		;COMPARE D0 AND D1
  Thu Apr 20 1989 11:55                                                                                                  Page   21




 1131   0000082C   66FF 0000 0012      		BNE	TSTERR_L	;NOT EQUAL THEN RAM_ERROR
 1132   00000832   B3CD                		CMP.L	A5,A1		;CURRENT ADDRESS < START ADDRESS ?
 1133   00000834   6500 F8EA           		BCS	STOP		;YES THEN END JOB
 1134   00000838   B5C9                		CMP.L	A1,A2		;IS END ADDRESS ?
 1135   0000083A   64C4                		BCC	RAM_L_T1	;NOT END,CONTINUE
 1136   0000083C   6000 F8E2           		BRA	STOP		;END,JMP TO CAN END
 1137                                  		;
 1138   00000840                       	TSTERR_L:
 1139   00000840   5589                		SUBQ.L	#2,A1
 1140   00000842                       	TSTERR_W:
 1141   00000842   5389                		SUBQ.L	#1,A1
 1142   00000844                       	TSTERR_B:
 1143   00000844   5389                		SUBQ.L	#1,A1
 1144   00000846                       	RAMERR:
 1145   00000846   1030 0170 000C 0000 		move.b	(+$c0000,a0), d0 ;disable trigger WR yeh:9/14/88
 1146   0000084E   38BC FF00           		MOVE.W	#$0FF00,(A4)	;SET ERROR FLAG TO (A4)
 1147   00000852   2089                		MOVE.L	A1,(A0)
 1148   00000854   6000 F8CA           		BRA	STOP		;JMP TO CAN END
 1149                                  	
 1150                                  	;================================================================
 1151                                  	; MEMORY SEARCH :						=
 1152                                  	; A0= Search data start address 				=
 1153                                  	; A1= Source start address					=
 1154                                  	; A2= Source end address					=
 1155                                  	; A3= Length of search data					=
 1156                                  	; A4= Flg address						=
 1157                                  	;================================================================
 1158                                  	
 1159                                  	;----------------------------------------------------------------
 1160                                  	; MEMORY SEARCH WITH BYTE FORMAT
 1161                                  	;----------------------------------------------------------------
 1162   00000858                       	M_SEARCH_B:
 1163   00000858   2C49                		MOVE.L	A1,A6		;MATCH adr.=A1
 1164   0000085A   2209                		MOVE.L	A1,D1		;SAVE START ADDRESS TO D1
 1165   0000085C                       	M_SRCH1_B:
 1166   0000085C   183C 0001           		MOVE.B	#1,D4		;INITIAL EVEN/ODD FLAG
 1167   00000860   240B                		MOVE.L	A3,D2		;INITIAL COUNT
 1168   00000862   2A48                		MOVE.L	A0,A5		;INITIAL DATA POINT
 1169   00000864                       	NXT_SRCH_B:
 1170   00000864   B5C9                		CMP.L	A1,A2		;adr. END ? (A1>A2)
 1171   00000866   65FF 0000 006E      		BCS	SRCH_FAILU	;YES, SET SEARCH FALURE FLG
 1172   0000086C   0E19 0000           		MOVES.B (A1)+,D0	;READ DATA FROM MEMORY AND MOVE adr.
 1173   00000870   0A04 0001           		EORI.B	#1,D4		;ODD ?
 1174   00000874   66FF 0000 0006      		BNE	ODD_SRCH	;YES, GET DATA FROM D3 HIGH BYTE
 1175   0000087A   361D                		MOVE.W	(A5)+,D3	;READ NEXT WORD FROM BUFFER
 1176   0000087C                       	ODD_SRCH:
 1177   0000087C   E05B                		ROR.W	#8,D3		;SWAP HIGH/LOW BYTE
 1178   0000087E   B600                		CMP.B	D0,D3		;DATA MATCH ?
 1179   00000880   67FF 0000 0012      		BEQ	MATCH1_B	;YES,MATCH ONE DATA
 1180   00000886   528E                		ADDQ.L	#1,A6		;MOVE MATCH adr. TO NEXT adr.
 1181   00000888   BDC1                		CMP.L	D1,A6		;OVER FFFFFFFF ?
 1182   0000088A   65FF 0000 004A      		BCS	SRCH_FAILU	;YES, END OF SEARCH
 1183   00000890   224E                		MOVE.L	A6,A1		;RESTORE CURRENT adr.
 1184   00000892   60C8                		BRA	M_SRCH1_B	;TRY AGAIN
 1185   00000894                       	MATCH1_B:
 1186   00000894   5382                		SUBQ.L	#1,D2		;COUNT=COUNT-1 , COUNT=0 ?
 1187   00000896   66CC                		BNE	NXT_SRCH_B	;NO, COMPARE NEXT DATA
  Thu Apr 20 1989 11:55                                                                                                  Page   22




 1188   00000898   60FF 0000 0032      		BRA	MS_SUCCES	;YES, SEARCH SUCCED
 1189                                  	
 1190                                  	;----------------------------------------------------------------
 1191                                  	; MEMORY SEARCH WITH WORD FORMAT
 1192                                  	;----------------------------------------------------------------
 1193   0000089E                       	M_SEARCH_W:
 1194   0000089E   2C49                		MOVE.L	A1,A6		;MATCH adr.=A1
 1195   000008A0   2209                		MOVE.L	A1,D1		;SAVE START ADDRESS TO D1
 1196   000008A2                       	M_SRCH1_W:
 1197   000008A2   240B                		MOVE.L	A3,D2		;INITIAL COUNT
 1198   000008A4   2A48                		MOVE.L	A0,A5		;INITIAL DATA POINT
 1199   000008A6                       	NXT_SRCH_W:
 1200   000008A6   B5C9                		CMP.L	A1,A2		;adr. END ? (A1>A2)
 1201   000008A8   65FF 0000 002C      		BCS	SRCH_FAILU	;YES, SET SEARCH FALURE FLG
 1202   000008AE   0E59 0000           		MOVES.W (A1)+,D0	;READ DATA FROM MEMORY AND MOVE adr.
 1203   000008B2   B05D                		CMP.W	(A5)+,D0	;DATA MATCH ? (AND MOVE DATA PONT)
 1204   000008B4   67FF 0000 0012      		BEQ	MATCH1_W	;YES,MATCH ONE DATA
 1205   000008BA   548E                		ADDQ.L	#2,A6		;MOVE MATCH adr. TO NEXT adr.
 1206   000008BC   BDC1                		CMP.L	D1,A6		;OVER FFFFFFFF ?
 1207   000008BE   65FF 0000 0016      		BCS	SRCH_FAILU	;YES, END OF SEARCH
 1208   000008C4   224E                		MOVE.L	A6,A1		;RESTORE CURRENT adr.
 1209   000008C6   60DA                		BRA	M_SRCH1_W	;TRY AGAIN
 1210   000008C8                       	MATCH1_W:
 1211   000008C8   5582                		SUBQ.L	#2,D2		;COUNT=COUNT-1 , COUNT=0 ?
 1212   000008CA   66DA                		BNE	NXT_SRCH_W	;NO, COMPARE NEXT DATA
 1213                                  	;----------------------------------------------------------------
 1214   000008CC                       	MS_SUCCES:
 1215   000008CC   208E                		MOVE.L	A6,(A0) 	;SAVE MATCH ADDRESS
 1216   000008CE   38BC FF00           		MOVE.W	#0FF00H,(A4)	;SET MATCH FLG
 1217   000008D2   6000 F84C           		BRA	STOP		;END SEARCH JOB
 1218   000008D6                       	SRCH_FAILU:
 1219   000008D6   38BC 0000           		MOVE.W	#0,(A4) 	;SET FAILURE FLG
 1220   000008DA   6000 F844           		BRA	STOP		;END SEARCH
 1221                                  	;----------------------------------------------------------------
 1222                                  	; MEMORY SEARCH WITH LONG-WORD FORMAT
 1223                                  	;----------------------------------------------------------------
 1224   000008DE                       	M_SEARCH_L:
 1225   000008DE   2C49                		MOVE.L	A1,A6		;MATCH adr.=A1
 1226   000008E0   2209                		MOVE.L	A1,D1		;SAVE START ADDRESS TO D1
 1227   000008E2                       	M_SRCH1_L:
 1228   000008E2   240B                		MOVE.L	A3,D2		;INITIAL COUNT
 1229   000008E4   2A48                		MOVE.L	A0,A5		;INITIAL DATA POINT
 1230   000008E6                       	NXT_SRCH_L:
 1231   000008E6   B5C9                		CMP.L	A1,A2		;adr. END ? (A1>A2)
 1232   000008E8   65EC                		BCS	SRCH_FAILU	;YES, SET SEARCH FALURE FLG
 1233   000008EA   0E99 0000           		MOVES.L (A1)+,D0	;READ DATA FROM MEMORY AND MOVE adr.
 1234   000008EE   B09D                		CMP.L	(A5)+,D0	;DATA MATCH ? (AND MOVE DATA PONT)
 1235   000008F0   67FF 0000 000E      		BEQ	MATCH1_L	;YES,MATCH ONE DATA
 1236   000008F6   588E                		ADDQ.L	#4,A6		;MOVE MATCH adr. TO NEXT adr.
 1237   000008F8   BDC1                		CMP.L	D1,A6		;OVER FFFFFFFF ?
 1238   000008FA   65DA                		BCS	SRCH_FAILU	;YES, END OF SEARCH
 1239   000008FC   224E                		MOVE.L	A6,A1		;RESTORE CURRENT adr.
 1240   000008FE   60E2                		BRA	M_SRCH1_L	;TRY AGAIN
 1241   00000900                       	MATCH1_L:
 1242   00000900   5982                		SUBQ.L	#4,D2		;COUNT=COUNT-1 , COUNT=0 ?
 1243   00000902   66E2                		BNE	NXT_SRCH_L	;NO, COMPARE NEXT DATA
 1244   00000904   60C6                		BRA	MS_SUCCES	;YES, SEARCH SUCCED
  Thu Apr 20 1989 11:55                                                                                                  Page   23




 1245                                  	
 1246                                  	;================================================================
 1247                                  	; INPUT:							=
 1248                                  	; A0= Canned buffer start address				=
 1249                                  	; A1= Input port						=
 1250                                  	; A2= Count							=
 1251                                  	;================================================================
 1252                                  	
 1253                                  	;----------------------------------------------------------------
 1254                                  	; INPUT with BYTE format
 1255                                  	;----------------------------------------------------------------
 1256   00000906                       	INPUT_B:
 1257   00000906   260A                		MOVE.L	A2,D3		;SET D3=COUNT
 1258   00000908                       	INPUT1_B:
 1259   00000908   0E19 0000           		MOVES.B (A1)+,D0		;INPUT ONE DATA FROM PORT
 1260   0000090C   E148                		LSL.W	#8,D0		;SHIFT DATA TO HIGH BYTE
 1261   0000090E   5383                		SUBQ.L	#1,D3		;END OF DATA ?
 1262   00000910   67FF 0000 0012      		BEQ	END_INPUT	;YES, END INPUT JOB
 1263   00000916   0E19 0000           		MOVES.B (A1)+,D0	;GET DATA FROM PORT AND PUT IT TO D0 LOW BYTE
 1264   0000091A   30C0                		MOVE.W	D0,(A0)+	;SAVE WORD DATA TO BUFFER
 1265   0000091C   5383                		SUBQ.L	#1,D3		;END OF COUNT ?
 1266   0000091E   6700 F800           		BEQ	STOP		;YES, END OF JOB
 1267   00000922   60E4                		BRA	INPUT1_B	;NEXT PORT
 1268   00000924                       	END_INPUT:
 1269   00000924   30C0                		MOVE.W	D0,(A0)+	;SAVE LAST DATA TO BUFFER
 1270   00000926   6000 F7F8           		BRA	STOP		;END INPUT
 1271                                  	;----------------------------------------------------------------
 1272                                  	; INPUT with WORD format
 1273                                  	;----------------------------------------------------------------
 1274   0000092A                       	INPUT_W:
 1275   0000092A   260A                		MOVE.L	A2,D3		;SET D3 = COUNT
 1276   0000092C                       	INPUT1_W:
 1277   0000092C   0E59 0000           		MOVES.W (A1)+,D0	;INPUT ONE DATA FROM PORT
 1278   00000930   30C0                		MOVE.W	D0,(A0)+	;SAVE THE INPUT DATA TO BUFFER
 1279   00000932   5583                		SUBQ.L	#2,D3		;END OF DATA ?
 1280   00000934   6700 F7EA           		BEQ	STOP		;YES, END INPUT JOB
 1281   00000938   60F2                		BRA	INPUT1_W		;END DELAY, NEXT INPUT
 1282                                  	;----------------------------------------------------------------
 1283                                  	; INPUT with LONG-WORD format
 1284                                  	;----------------------------------------------------------------
 1285   0000093A                       	INPUT_L:
 1286   0000093A   260A                		MOVE.L	A2,D3		;SET D3 = COUNT
 1287   0000093C                       	INPUT1_L:
 1288   0000093C   0E99 0000           		MOVES.L (A1)+,D0	;INPUT ONE DATA FROM PORT
 1289   00000940   20C0                		MOVE.L	D0,(A0)+	;SAVE THE INPUT DATA TO BUFFER
 1290   00000942   5983                		SUBQ.L	#4,D3		;END OF DATA ?
 1291   00000944   6700 F7DA           		BEQ	STOP		;YES, END INPUT JOB
 1292   00000948   60F2                		BRA	INPUT1_L		;END DELAY, NEXT INPUT
 1293                                  	;================================================================
 1294                                  	; OUTPUT :							=
 1295                                  	; A0= Canned buffer start address				=
 1296                                  	; A1= Output port						=
 1297                                  	; A2= Data count						=
 1298                                  	;================================================================
 1299                                  	
 1300                                  	;----------------------------------------------------------------
 1301                                  	;Output with BYTE format
  Thu Apr 20 1989 11:55                                                                                                  Page   24




 1302                                  	;----------------------------------------------------------------
 1303   0000094A                       	OUTPUT_B:
 1304   0000094A   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
 1305   00000952   183C 0001           		MOVE.B	#1,D4		;INITIAL EVEN/ODD FLAG
 1306   00000956   260A                		MOVE.L	A2,D3		;SET D3 = COUNT
 1307   00000958                       	OUTPUT1_B:
 1308   00000958   0A04 0001           		EORI.B	#1,D4		;ODD ?
 1309   0000095C   66FF 0000 0006      		BNE	OUTPUT2_B	;YES, GET DATA FROM D0 HIGH BYTE
 1310   00000962   3018                		MOVE.W	(A0)+,D0	;EVEN, THEN GET NEXT DATA FROM BUFFER
 1311   00000964                       	OUTPUT2_B:
 1312   00000964   E058                		ROR.W	#8,D0		;SWAP HIGH/LOW BYTE
 1313   00000966   0E11 0800           		MOVES.B D0,(A1) 	;OUT DATA TO PORT
 1314   0000096A   720A                		MOVE.L	#10,D1		;INITIAL DELAY COUNT
 1315   0000096C                       	OUT_B_DLY:
 1316   0000096C   5381                		SUBQ.L	#1,D1		;DELAY LOOP
 1317   0000096E   66FC                		BNE	OUT_B_DLY	;END COUNT ? IF NOT THEN CONTINUE
 1318   00000970   5383                		SUBQ.L	#1,D3		;END OF DATA ?
 1319   00000972   66E4                		BNE	OUTPUT1_B	;NO, OUTPUT NEXT
 1320   00000974   6000 F7AA           		BRA	STOP		;END OF OUTPUT JOB
 1321                                  	;----------------------------------------------------------------
 1322                                  	;Output with WORD format
 1323                                  	;----------------------------------------------------------------
 1324   00000978                       	OUTPUT_W:
 1325   00000978   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
 1326   00000980   260A                		MOVE.L	A2,D3		;SET D3 = COUNT
 1327   00000982                       	OUTPUT1_W:
 1328   00000982   3018                		MOVE.W	(A0)+,D0	;GET DATA FROM BUFFER
 1329   00000984   0E51 0800           		MOVES.W D0,(A1) 	;OUT DATA TO PORT
 1330   00000988   720A                		MOVE.L	#10,D1		;INITIAL DELAY COUNT
 1331   0000098A                       	OUT_W_DLY:
 1332   0000098A   5381                		SUBQ.L	#1,D1		;DELAY LOOP
 1333   0000098C   66FC                		BNE	OUT_W_DLY	;END COUNT ? IF NOT THEN CONTINUE
 1334   0000098E   5583                		SUBQ.L	#2,D3		;END OF DATA ?
 1335   00000990   66F0                		BNE	OUTPUT1_W	;NO, OUTPUT NEXT
 1336   00000992   6000 F78C           		BRA	STOP		;END OF OUTPUT JOB
 1337                                  	;----------------------------------------------------------------
 1338                                  	;Output with LONG_WORD format
 1339                                  	;----------------------------------------------------------------
 1340   00000996                       	OUTPUT_L:
 1341   00000996   1030 0170 0008 0000 		move.b	(+$80000,a0), d0 ; enable trigger WR yeh:9/14/88
 1342   0000099E   260A                		MOVE.L	A2,D3		;SET D3 = COUNT
 1343   000009A0                       	OUTPUT1_L:
 1344   000009A0   2018                		MOVE.L	(A0)+,D0	;GET DATA FROM BUFFER
 1345   000009A2   0E91 0800           		MOVES.L D0,(A1) 	;OUT DATA TO PORT
 1346   000009A6   720A                		MOVE.L	#10,D1		;INITIAL DELAY COUNT
 1347   000009A8                       	OUT_L_DLY:
 1348   000009A8   5381                		SUBQ.L	#1,D1		;DELAY LOOP
 1349   000009AA   66FC                		BNE	OUT_L_DLY	;END COUNT ? IF NOT THEN CONTINUE
 1350   000009AC   5983                		SUBQ.L	#4,D3		;END OF DATA ?
 1351   000009AE   66F0                		BNE	OUTPUT1_L	;NO, OUTPUT NEXT
 1352   000009B0   6000 F76E           		BRA	STOP		;END OF OUTPUT JOB
 1353                                  	;----------------------------------------------------------------
 1354                                  	;Clock sence			 yeh: 10/03/88
 1355                                  	;----------------------------------------------------------------
 1356   000009B4                       	clock_sence:
 1357   000009B4   2009                		move.l	a1,d0		;time constant for counter
 1358   000009B6                       	clock_loop:
  Thu Apr 20 1989 11:55                                                                                                  Page   25




 1359   000009B6   4E71                		NOP
 1360   000009B8   4E71                		NOP
 1361   000009BA   4E71                		NOP
 1362   000009BC   4E71                		NOP
 1363   000009BE   5380                		subq.l	#1,d0
 1364   000009C0   4E71                		NOP
 1365   000009C2   4E71                		NOP
 1366   000009C4   4E71                		NOP
 1367   000009C6   4E71                		NOP
 1368   000009C8   66EC                		bne	clock_loop
 1369   000009CA   6000 F754           		bra	STOP
 1370                                  	;----------------------------------------------------------------
 1371                                  	;DEFINED WORD OF ENTRY POINTER
 1372                                  	;----------------------------------------------------------------
 1373                                  	;START OF ENTRY
 1374   000009CE   0124                		DW	GET_PARAMETER		;PARAMETER
 1375   000009D0   014C                		DW	BANK0			;BANK0_PTR
 1376   000009D2   015E                		DW	BANK1			;BANK1_PTR
 1377   000009D4   0172                		DW	BANK2			;BANK2_PTR
 1378   000009D6   0186                		DW	BANK3			;BANK3_PTR
 1379   000009D8   01CE                		DW	SAVALL			;SAVALL_PTR
 1380   000009DA   0206                		DW	GET68881		;GET68881_PTR
 1381   000009DC   0228                		DW	SAVE68881		;SAVE68881_PTR
 1382   000009DE   024A                		DW	DISP_B_MEMORY		;DISPB_PTR
 1383   000009E0   0276                		DW	DISP_W_MEMORY		;DISPW_PTR
 1384   000009E2   028C                		DW	DISP_L_MEMORY		;DISPL_PTR
 1385   000009E4   02A2                		DW	BLOCK_B_FILL		;BFILLB_PTR
 1386   000009E6   02D6                		DW	BLOCK_W_FILL		;BFILLW_PTR
 1387   000009E8   0360                		DW	BLOCK_L_FILL		;BFILLL_PTR
 1388   000009EA   03EE                		DW	COMPARE_B		;COMPAREB_PTR
 1389   000009EC   0424                		DW	COMPARE_W		;COMPAREW_PTR
 1390   000009EE   045A                		DW	COMPARE_L		;COMPAREL_PTR
 1391   000009F0   04A8                		DW	FRWD_B_MOV		;FMOVEB_PTR
 1392   000009F2   04E2                		DW	FRWD_W_MOV		;FMOVEW_PTR
 1393   000009F4   051C                		DW	FRWD_L_MOV		;FMOVEL_PTR
 1394   000009F6   0558                		DW	BKRD_B_MOV		;BMOVEB_PTR
 1395   000009F8   059C                		DW	BKRD_W_MOV		;BMOVEW_PTR
 1396   000009FA   05E0                		DW	BKRD_L_MOV		;BMOVEL_PTR
 1397   000009FC   0624                		DW	CHECKSUM_B		;CHKSUMB_PTR
 1398   000009FE   0646                		DW	CHECKSUM_W		;CHKSUMW_PTR
 1399   00000A00   0666                		DW	CHECKSUM_L		;CHKSUML_PTR
 1400   00000A02   0686                		DW	RAM_B_TEST		;RAMTSTB_PTR
 1401   00000A04   0702                		DW	RAM_W_TEST		;RAMTSTW_PTR
 1402   00000A06   07A0                		DW	RAM_L_TEST		;RAMTSTL_PTR
 1403   00000A08   0858                		DW	M_SEARCH_B		;SEARCHB_PTR
 1404   00000A0A   089E                		DW	M_SEARCH_W		;SEARCHW_PTR
 1405   00000A0C   08DE                		DW	M_SEARCH_L		;SEARCHL_PTR
 1406   00000A0E   0906                		DW	INPUT_B 		;INPUTB_PTR
 1407   00000A10   092A                		DW	INPUT_W 		;INPUTW_PTR
 1408   00000A12   093A                		DW	INPUT_L 		;INPUTL_PTR
 1409   00000A14   094A                		DW	OUTPUT_B		;OUTPUTB_PTR
 1410   00000A16   0978                		DW	OUTPUT_W		;OUTPUTW_PTR
 1411   00000A18   0996                		DW	OUTPUT_L		;OUTPUTL_PTR
 1412   00000A1A   09B4                		dw	clock_sence		;clock_ptr
 1413                                  	;END OF ENTRY
 1414                                  	;----------------------------------------------------------------
 1415   00000A1C                       		END



           Lines Assembled :  1415             Assembly Errors :  0


