ATmega8(L)
When the BOOTRST Fuse is unprogrammed, the boot section size set to 2Kbytes and the
IVSEL bit in the GICR Register is set before any interrupts are enabled, the most typical and
general program setup for the Reset and Interrupt Vector Addresses is:
AddressLabelsCode
Comments
$000
;
rjmp
RESET
; Reset handler
$001
$002
$003
$004
$005
$006
;
RESET:ldi
r16,high(RAMEND); Main program start
out
ldi
out
sei
SPH,r16
; Set Stack Pointer to top of RAM
r16,low(RAMEND)
SPL,r16
; Enable interrupts
<instr> xxx
.org $c01
$c01
$c02
...
rjmp
rjmp
...
EXT_INT0
; IRQ0 Handler
; IRQ1 Handler
EXT_INT1
...;
$c12
rjmp
SPM_RDY
; Store Program Memory Ready Handler
When the BOOTRST Fuse is programmed and the boot section size set to 2Kbytes, the most
typical and general program setup for the Reset and Interrupt Vector Addresses is:
AddressLabelsCode
Comments
.org $001
$001
$002
...
$012
;
rjmp
rjmp
...
EXT_INT0
EXT_INT1
...
; IRQ0 Handler
; IRQ1 Handler
;
rjmp
SPM_RDY
; Store Program Memory Ready Handler
.org $c00
$c00
;
rjmp
RESET
; Reset handler
$c01
$c02
$c03
$c04
$c05
$c06
RESET:ldi
r16,high(RAMEND); Main program start
out
ldi
out
sei
SPH,r16
; Set Stack Pointer to top of RAM
r16,low(RAMEND)
SPL,r16
; Enable interrupts
<instr> xxx
48
2486AA–AVR–02/2013