Atmega16(l) – Rainbow Electronics ATmega64L User Manual
Page 44

44
ATmega16(L)
2466B–09/01
When the BOOTRST fuse is unprogrammed, the boot section size set to 2K bytes and
the IVSEL bit in the GICR register is set before any interrupts are enabled, the most typ-
ical and general program setup for the Reset and Interrupt Vector Addresses is:
Address
Labels
Code
Comments
$000
RESET:
ldi
r16,high(RAMEND) ; Main program start
$001
out
SPH,r16
; Set stack pointer to top of RAM
$002
ldi
r16,low(RAMEND)
$003
out
SPL,r16
$004
sei
; Enable interrupts
$005
xxx
;
.org $1C02
$1C02
jmp
EXT_INT0
; IRQ0 Handler
$1C04
jmp
EXT_INT1
; IRQ1 Handler
...
....
..
;
$1C28
jmp
SPM_RDY
; Store Program Memory Ready Handler
When the BOOTRST fuse is programmed and the boot section size set to 2K bytes, the
most typical and general program setup for the Reset and Interrupt Vector Addresses is:
Address
Labels
Code
Comments
.org $002
$002
jmp
EXT_INT0
; IRQ0 Handler
$004
jmp
EXT_INT1
; IRQ1 Handler
...
....
..
;
$028
jmp
SPM_RDY
; Store Program Memory Ready Handler
;
.org $1C00
$1C00
RESET:
ldi
r16,high(RAMEND) ; Main program start
$1C01
out
SPH,r16
; Set stack pointer to top of RAM
$1C02
ldi
r16,low(RAMEND)
$1C03
out
SPL,r16
$1C04
sei
; Enable interrupts
$1C05
xxx
When the BOOTRST fuse is programmed, the boot section size set to 2K bytes 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:
Address
Labels
Code
Comments
.org $1C00
$1C00
jmp
RESET
; Reset handler
$1C02
jmp
EXT_INT0
; IRQ0 Handler
$1C04
jmp
EXT_INT1
; IRQ1 Handler
...
....
..
;
$1C28
jmp
SPM_RDY
; Store Program Memory Ready Handler
;
$1C2A
RESET:
ldi
r16,high(RAMEND) ; Main program start
$1C2B
out
SPH,r16
; Set stack pointer to top of RAM
$1C2C
ldi
r16,low(RAMEND)
$1C2D
out
SPL,r16
$1C2E
sei
; Enable interrupts
$1C2F
xxx