;**************************************************************************************
; file = test_32.asm		Author: Dr. Eric M. Schwartz	Date: 13 Feb 2012
;
; Description:
; This program will be used to test moving 32 bits at a time
; 	between pairs of memory, the accumulator, and the auxiliary reisters 
		.global		_c_int00
WDT			.set	0x7029		; watch dog timer
SCIB_VECTOR	.set	0x0DC4		; will also work with 22-bit addresses
;***************************** Program Constants **************************************
; none
;******************* DATA ALLOCATION SECTION - Variables/Data *************************
		;DATA section, starting at 0xA000.
		.data
NUM1	.long		0x89ABCDEF		; stores in A000 and A001
NUM2	.long		0x01234567		; stores in A000 and A001

	    ;.BSS SECTION, starting address is 0xB000
		.bss 	Var1, 2				; set up 32 bits in memory
		.bss	Var2, 2	    		; set up 32 bits in memory
		;.global directive lets you to see the assigned addresses in map file.	    
		.global		NUM1, NUM2
;*********************************Program Text*****************************************
		.text					;Program section, starting at 0x9000
_c_int00:
		EALLOW					; allow protected instructions
		SETC   OBJMODE			; allow 32 bit instructions

		MOV    AR0,#WDT   		;kill the watch dog timer
		MOV    *AR0,#0x68

		MOVL   XAR0,#SCIB_VECTOR
		MOV	   ACC, #SCIB_ISR
		MOVL   *XAR0, ACC
		
MEMtoACC:
        ; moves 32 bits from data to ACC
       	MOV    AR0, #NUM1    		; AR0- pointer to 32 bits to be copied
       	MOVL   ACC, *AR0     		; stuff at pointer location (32 bits) -> ACC
MEMtoAUX:
        ; moves 32 bits from data to XAR1  
       	MOV    AR0, #NUM2     		; AR0- pointer to 32 bits to be copied
       	MOVL   XAR1, *AR0    		; stuff at pointer location (32 bits) -> XAR1
ACCtoAUX:
        ; moves 32 bits from ACC to XAR2
        MOVL   XAR2, ACC      		; stuff in ACC (32 bits) -> XAR2
AUXtoACC:
        ; moves 32 bits from XAR1 to ACC
       	MOVL   ACC, XAR1      		; stuff in AR3 (32 bits) -> ACC
AUXtoAUX:
        ; moves 32 bits from XAR2 to XAR1
       	MOVL   XAR1, XAR2      		; stuff in XAR2 (32 bits) -> XAR1
ACCtoMEM:
        ; moves 32 bits from ACC to memory  
        MOV    AR0, #Var1     		; AR0- pointer to memory (32 bits)
       	MOVL   *AR0, ACC    		; ACC -> loc in memory (Var1) (32 bits)
AUXtoMEM:
        ; moves 32 bits from XAR1 to memory  
        MOV    AR0, #Var2     		; AR0- pointer to memory (32 bits)
        MOVL   *AR0, XAR1    		; XAR1 -> loc in memory (Var2) (32 bits)
        	
HERE:	B      HERE, UNC			; chase tail

SCIB_ISR:
        NOP
        B      SCIB_ISR, UNC
