ARM VERSION 1.2 Guide de l'utilisateur Page 84

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 133
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 83
vectors.o (Vect, +First)
* (+RO)
}
RAM 0x28000000
{
* (+RW,+ZI)
}
HEAP +0 UNINIT
{
heap.o (+ZI)
}
STACKS 0x28080000 UNINIT
{
stack.o (+ZI)
}
UART0 0x16000000 UNINIT
{
uart.o (+ZI)
}
}
6.5.3 Sample code
The code in Example 6-3 contains example exception vectors and exception handlers. For this application, ROM is
fixed at 0x0 and the exception table is hard-coded at 0x0. For Loading the ROM image at address 0, ROM/RAM
remapping occurs and the vectors are copied from ROM to RAM.
Example 6-3 vectors.s
AREA Vect, CODE, READONLY
; Where there is ROM fixed at 0x0 (build_b), these are hard-coded at 0x0.
; Where ROM/RAM remapping occurs (build_c), these are copied from ROM to RAM.
; The copying is done automatically by the C library code inside __main.
; *****************
; Exception Vectors
; *****************
; Note: LDR PC instructions are used here, though branch (B) instructions
; could also be used, unless the ROM is at an address >32MB.
LDR PC, Reset_Addr
LDR PC, Undefined_Addr
LDR PC, SWI_Addr
LDR PC, Prefetch_Addr
LDR PC, Abort_Addr
NOP ; Reserved vector
LDR PC, IRQ_Addr
LDR PC, FIQ_Addr
IMPORT Reset_Handler ; In init.s
Reset_Addr DCD Reset_Handler
Undefined_Addr DCD Undefined_Handler
SWI_Addr DCD SWI_Handler
Prefetch_Addr DCD Prefetch_Handler
Abort_Addr DCD Abort_Handler
IRQ_Addr DCD IRQ_Handler
FIQ_Addr DCD FIQ_Handler
; ************************
; Exception Handlers
; The following dummy handlers do not do anything useful in this example.
; They are set up here for completeness.
Undefined_Handler
B Undefined_Handler
SWI_Handler
B SWI_Handler
Prefetch_Handler
B Prefetch_Handler
Abort_Handler
B Abort_Handler
IRQ_Handler
B IRQ_Handler
FIQ_Handler
B FIQ_Handler
Writing Code for ROM
Copyright ?1999 2001 ARM Limited 6-9
Vue de la page 83
1 2 ... 79 80 81 82 83 84 85 86 87 88 89 ... 132 133

Commentaires sur ces manuels

Pas de commentaire