Motorola M68CPU32BUG User Manual Page 32

  • Download
  • Add to my manuals
  • Print
  • Page
    / 56
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 31
MOTOROLA MC68332TUT/D
32
4.1.3.1 Initializing the Reset Vector
Immediately after the release of RESET, an internal state machine fetches the word values at addresses
$000000 through $000006 and loads them into the stack pointer and program counter. These values, gen-
erally referred to collectively as the as reset vector, are shown in Table 6. The values in the reset vector
must be initialized in order for program execution to begin.
.
Sample code to initialize the reset vector follows. Make sure that the stack does not overlap the program
code (the stack grows downward in memory). If the assembler does not recognize “DW”, check the manual
to determine the format for defining a constant word. Another common format is “DC.W.”
org $0000 ;begin at address $000000 of memory map
DW $0000 ;initial stack pointer = $4000
DW $4000
DW $0000 ;initial PC = $400
DW $0400
4.1.3.2 Initializing Exception Vectors other than Reset
Each exception vector should point to a handler routine in case the exception is accidentally taken. In an
actual program, the vectors would point to different labels, but in the example below, all of the vectors point
to the same label (INT). This label must be included later on in the code in case an exception is taken. This
example assumes that the label INT is at an address less than $10000. In other words, the upper word of
the address is $0000.
Table 5 Exception Vector Table
Vector Number
(Decimal)
Vector Offset
(Hexadecimal)
Assignment
0 0 Reset: Initial Stack Pointer
1 4 Reset: Initial Program Counter
2 - 15 8 - 3C Various Errors and Exceptions
16 - 23 40 - 5C Unassigned, Reserved
24 60 Spurious Interrupt
25 64 Level 1 Interrupt Autovector
26 68 Level 2 Interrupt Autovector
27 6C Level 3 Interrupt Autovector
28 70 Level 4 Interrupt Autovector
29 74 Level 5 Interrupt Autovector
30 78 Level 6 Interrupt Autovector
31 7C Level 7 Interrupt Autovector
32 - 47 80 - BC Trap Instruction Vectors
48 - 63 C0 - FC Unassigned/Reserved
64 - 255 100 - 3FC User Defined Vectors
Table 6 Reset Vector for CPU32
Address Reset Vector
$0000 Initial Stack Pointer Upper Word
$0002 Initial Stack Pointer Lower Word
$0004 Initial Program Counter Upper Word
$0006 Initial Program Counter Lower Word
Page view 31
1 2 ... 27 28 29 30 31 32 33 34 35 36 37 ... 55 56

Comments to this Manuals

No comments