;***************************************************************************
;* File Name		:mc_test0.asm
;* Title		:First Microcontroller Test
;* Date	 		:08/31/97
;* Version 		:1.0
;* Target MCU		:AT90S1200
;* 
;* DESCRIPTION
;* Test of simple port I/O
;***************************************************************************

;***** Directives

.device at90s1200		; Device is AT90S1200
.nolist
.include "1200def.inc"
.list

.def	temp 	= r16


;***** Interrupt vector table

	rjmp	RESET		; Reset handle
	reti			; External Interrupt0 handle
	reti			; Overflow0 Interrupt handle
	reti			; Analog Comparator Interrupt handle

;***** Main

RESET:	ser	temp
	out	DDRB,temp	; PORTB = all outputs

	sec
	ldi	temp, $FE	
	out	PORTB, temp	; Set bit pattern
	
loop:	sbic	PIND,2		; Wait until key is pressed
	rjmp	loop
	rol	temp		; Rotate bit pattern
	out	PORTB, temp	; Output rotated bit pattern
wait:	sbis	PIND,2		; Wait until key is unpressed
	rjmp	wait
	rjmp 	loop		; Repeat forever
	

