* Pass the parameter address (pointer) in the internal registers.

**** Main routine
        ORG     $0B00
DATA:   DC.B     $37, $A3
**** Main routine
	ORG	$0900	;Start program at $0900
START:	LDS	#$900	;initialize stack pointer
        LDX     #DATA       ;Load X index reg. with
*                           ;  the address of data
        JSR     AVG         ;Call subroutine AVG
*                           ;  to get the average
HERE:	BRA	HERE	    ;Stay here (endless loop)

*********************************************************
**** Subroutine: AVG
* Get the average of two data bytes in successive memory
* locations starting at the location pointed to by X
* Output in A
AVG:    LDAA    0,X         ;A = 1st piece of data
        ADDA    1,X         ;A=A + 2nd piece of data
        ASRA                ;Divide by 2
        RTS

