Page 308 - Programming Microcontrollers in C
P. 308

The MC68HC16       293

                     _init_vector, * 6-Software Interrupt */
                     _init_vector, /* 7-Illegal Instruction */
                     _init_vector, /* 8-Divide by Zero */
                     _init_vector, /* 9-Reserved */
                     _init_vector, /* a-Reserved */
                     _init_vector, /* b-Reserved */
                     _init_vector, /* c-Reserved */
                     _init_vector, /* d-Reserved */
                     _init_vector, /* e-Reserved */
                     _init_vector, /* f-Uninitialized Interrupt */
                     _init_vector, /* 10-Reserved */
                     _init_vector,  /* 11-Level 1 Interrupt Autovector */
                     _init_vector,  /* 12-Level 2 Interrupt Autovector */
                     _init_vector,  /* 13-Level 3 Interrupt Autovector */
                     _init_vector,  /* 14-Level 4 Interrupt Autovector */
                     _init_vector,  /* 15-Level 5 Interrupt Autovector */
                     _init_vector,  /* 16-Level 6 Interrupt Autovector */
                     _init_vector,  /* 17-Level 7 Interrupt Autovector */
                     _init_vector,  /* 18-Spurious Interrupt */
                          /* vectors 0x19-0x37 unassigned, reserved */
                   0,0,0,0,0,0,0,
                   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                   /* put timer at vector 0x46 0x40 from ICR and 6 for OC3 */
                   0,0,0,0,0,0,OC3_Isr/*OC3_Isrvectorat0x46addressat0x8c*/
                   };

                   static @port void _init_vector(void)
                   { }

                              Listing 6-1: The Vector Initialization Routine vector.c
                              We have already seen the @port command in Chapter 5. The
                          @far command is unique to the Cosmic compiler. This command
                          notifies the compiler that the pointer associated with the command is
                          not the usual 16-bit pointer. An @far pointer is an extended pointer.
                          This 20-bit pointer will be placed into the first two memory words
                          by the vector.c routine. The rightmost 4 bits in word 0 is the
                          program counter extension PK, so that the placement of the 20-bit
   303   304   305   306   307   308   309   310   311   312   313