Atmega128(l) – Rainbow Electronics ATmega128L User Manual
Page 57

57
ATmega128(L)
2467B–09/01
When the BOOTRST fuse is unprogrammed, the boot section size set to 8K bytes and
the IVSEL bit in the MCUCR 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
$0000
RESET:ldi
r16,high(RAMEND)
; Main program start
$0001
out
SPH,r16
; Set stack pointer to top of RAM
$0002
ldi
r16,low(RAMEND)
$0003
out
SPL,r16
$0004
sei
; Enable interrupts
$0005
;
.org $F002
$F002
jmp
EXT_INT0
; IRQ0 Handler
$F004
jmp
EXT_INT1
; IRQ1 Handler
...
...
...
;
$F044
jmp
SPM_RDY
; Store Program Memory Ready Handler
When the BOOTRST fuse is programmed and the boot section size set to 8K bytes, the
most typical and general program setup for the Reset and Interrupt Vector Addresses is:
Address
Labels Code
Comments
.org $0002
$0002
jmp
EXT_INT0
; IRQ0 Handler
$0004
jmp
EXT_INT1
; IRQ1 Handler
...
...
...
;
$0044
jmp
SPM_RDY
; Store Program Memory Ready Handler
;
.org $F000
$F000
RESET: ldi
r16,high(RAMEND)
; Main program start
$F001
out
SPH,r16
; Set stack pointer to top of RAM
$F002
ldi
r16,low(RAMEND)
$F003
out
SPL,r16
$F004
sei
; Enable interrupts
$F005
When the BOOTRST fuse is programmed, the boot section size set to 8K bytes and the
IVSEL bit in the MCUCR register is set before any interrupts are enabled, the most typi-
cal and general program setup for the Reset and Interrupt Vector Addresses is:
Address
Labels
Code
Comments
;
.org $F000
$F000
jmp
RESET
; Reset handler
$F002
jmp
EXT_INT0
; IRQ0 Handler
$F004
jmp
EXT_INT1
; IRQ1 Handler
...
...
...
;
$F044
jmp
SPM_RDY ; Store Program Memory Ready Handler
$F046
RESET: ldi
r16,high(RAMEND)
; Main program start
$F047
out
SPH,r16
; Set stack pointer to top of RAM
$F048
ldi
r16,low(RAMEND)
$F049
out
SPL,r16
$F04A
sei
; Enable interrupts
$F04B