* Pass the parameter data in the internal registers.

**** Main routine
	ORG	$0900	;Start program at $0900
START:	LDS	#$900	;initialize stack pointer
	LDAA	#$37 	;Load data in the A
	LDAB	#$A3	;and B registers
	JSR	AVG	;Call subroutine AVG
*			; to get the average
HERE:	BRA	HERE	;Stay here (endless loop)

*********************************************************
**** Subroutine: AVG
* Get the average of Reg A & Reg B
* Output in accumulator A
AVG:	ABA		;A=A+B
	ASRA		;Shift A right by 1 bit
*			;  (divide by 2) keeping
*			;  bit 7 (for sign extension)  
	RTS