; ******************************************************
; BASIC .ASM template file for AVR
; ******************************************************



; Define here the variables
;
.def  temp  =r16

;Tiny 11 - Test of ADC - also include multiplex display driver.

; Specify Device.
.device ATTINY11

; I/O Register Definitions
.equ    SREG    =$3F
.equ    GIMSK   =$3B
.equ    GIFR    =$3A
.equ    TIMSK   =$39
.equ    TIFR    =$38
.equ    MCUCR   =$35
.equ    TCCR0   =$33
.equ    TCNT0   =$32
.equ    TCCR1   =$30
.equ    TCNT1   =$2F
.equ    OCR1A   =$2E
.equ    OCR1B   =$2D
.equ    PORTB   =$18
.equ	DDRB    =$17
.equ    ACSR    =$08
.equ    ADMUX   =$07
.equ    ADCSR   =$06
.equ    ADCH    =$05
.equ    ADCL    =$04

.cseg					; CODE segment.

;Interrupt Vectors
.org 0
	rjmp init			;Reset

;Initialization
init:

	ldi r16,$8		; 1 bit are outputs
	out DDRB,r16   	; set portb bit 3 for outputs to display
;	ldi r16,5		; Timer 0 rolls over at 1MHz/1024/256 = 97Hz/3
;	out TCCR0,r16

;	sei			; Enable Interrupts

	ldi r16,$8		; LED OFF
	out PORTB,r16


loop1:
	rcall Delay
	swap r16
	out PORTB,r16
	rjmp loop1

Delay:
ldi r17,200
d1: ldi r18,8
	d2: ldi r19,77
		d3: nop
			dec r19
		brne d3
		nop
	dec r18
	brne d2
	nop
	dec r17
brne d1
ret



