Xunhua Guo

program counter & reset vector

Discussion created by Xunhua Guo on Aug 25, 2007
Latest reply on Aug 25, 2007 by Xunhua Guo
   I am a HC08 beginner.  I wonder how the contents of Program Counter and RESET Vector ($FFFE,$FFFF) are set at the beging of a program.  Below is where the question stems from.
   I created a project with CW. In the automatic created file " INCLUDE 'derivative.inc" has this code:
        ROMStart:           equ   $00008000
        INT_RESET:       equ   $0000FFFE
   in the automatic created main.asm has this code:
      ; Include derivative-specific definitions
         INCLUDE 'derivative.inc'
      ; export symbols
            XDEF _Startup
            ABSENTRY _Startup
      ; variable/data section
           ORG    RAMStart         ; Insert your data definition here
           ExampleVar: DS.B   1
           TEMP1: EQU $0040

           ; code section
             ORG    ROMStart
             LDHX   #RAMEnd+1        ; initialize the stack pointer
            CLI                     ; enable interrupts
            ; Insert your code here
When simulating this program in CW, I found that both the contents of PC (program counter) and $FFFE,$FFFF are 8000.  I wonder how each content of the two is set?