;-----------------------------------------------------------------
; Name:			OutputCompareANDTest.asm
; Description:	Tests ServoDir register compare functionality
; 				When a respective switch is pressed, generate an output compart
;				to control a servo in the -90,0,90 directions
; Author:		Max Koessick
; Class:		EEL5666C, Intelligent Machine Design Lab
; Date:			June 6, 2003
; Revision		1.a
; Changes to Date:
;				6/6/03 First Revision
			
;-----------------------------------------------------------------


.include "m128def.inc"

; Interrupt service vectors

.org $0000
	rjmp Reset
Reset:
.def ServoDir = r18

	ldi ServoDir,$03
Main:
	cpi ServoDir,$01
	brne next
	ldi r19,$15				; simulated loading of OCR0
	rjmp main
Next:
	cpi ServoDir,$02
	brne next2
	ldi r19,$15				; simulated loading of OCR0
	rjmp main
Next2:
	cpi ServoDir,$03
	brne main				; if not,go to top and check again
	ldi r19,$15				; simulated loading of OCR0
	rjmp main
