Path: Home => AVR-main => beginners => Standard 8515 file

Standard 8515 programming file structure

; ***************************************************************
; *                                                             *
; *                                                             *
; *                                                             *
; *                                                             *
; *                                                             *
; * (C)2002 by                      Last change:                *
; ***************************************************************
;
; Hardware requirements:
;
; Software features:
;
.NOLIST
.INCLUDE "C:\avrtools\appnotes\8515def.inc"
.LIST
;
; Constants
;
.EQU xyz = 12345
;
; Used registers
;
.DEF mpr = R16
;
; Code starts here
;
.CSEG
.ORG $0000
;
; Reset- and Interrupt-vectors
;
   rjmp   Start  ; Reset-vector
   rjmp   IInt0  ; External Interrupt Request 0
   rjmp   IInt1  ; External Interrupt Request 1
   rjmp   TCpt1  ; Timer/Counter1 Capture event
   rjmp   TCmpA  ; Timer/Counter1 Compare match A
   rjmp   TCmpB  ; Timer/Counter1 Compare match B
   rjmp   TOvf1  ; Timer/Counter1 Overflow
   rjmp   TOvf0  ; Timer/Counter0 Overflow
   rjmp   URxAv  ; Uart Rx char available
   rjmp   UTxDe  ; Uart Tx data register empty
   rjmp   UTxCp  ; Uart Tx complete
   rjmp   AnaCp  ; Analog comparator
;
; ************** Interrupt service routines ********
;
; External Interrupt 0
;
IInt0:
   reti
;
; External Interrupt 1
;
IInt1:
   reti
;
; Timer/Counter 1, Capture event
;
TCpt1:
   reti
;
; Timer/Counter 1, Compare match interrupt A
;
TCmpA:
   reti
;
; Timer/Counter 1, Compare match interrupt B
;
TCmpB:
   reti
;
; Timer/Counter 1, Overflow interrupt
;
TOvf1:
   reti
;
; Timer/Counter 0, Overflow interrupt
;
TOvf0:
   reti
;
; SPI Serial Transfer Complete interrupt
;
SIStc:
   reti
;
; Uart Rx Complete Interrupt
;
URxAv:
   reti
;
; Uart Data register empty interrupt
;
UTxDe:
   reti
;
; Uart Tx complete interrupt
;
UTxCp:
   reti
;
; Analog comparator interrupt
;
AnaCp:
   reti
;
; **************** End of interrupt service routines ***********
;
; Various subroutines
;
; **************** End of the subroutine section ***************
;
; ******************** Main program ****************************
;
; Main program routine starts here
;
Start:
   rjmp start


©2002 by http://www.avr-asm-tutorial.net