Skip to main content
Visitor II
October 31, 2003
Question

where is __reset mapped?

  • October 31, 2003
  • 4 replies
  • 843 views
Posted on October 31, 2003 at 07:09

where is __reset mapped?

    This topic has been closed for replies.

    4 replies

    kapilAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 11:35

    where is __reset ,__halt , used in crtbegin.spp file,defined ? Where can i change their values?

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 11:35

    chaps,

    Value of _reset and _halt is calculated during link time based on the position these are defined in your startup file e.g. if you define _reset proc first thing in the init section of start up file _reset will be mapped at 0x00000. Normally its defiend after the defiinitions of interrupt vectors and DIVIDE_BY_ZERO_TRAP_DEFAULT and so gets its value after that and _halt is defined in the end but if you change their positions these will get mapped at the locations you want.

    Ritu
    kapilAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 11:35

    Yes you are right their actual values are calculated during the link time, which is visible in .map file.

    So you mean to say that every instruction in crtbegin.spp file is mapped directly on to the memory e.g. in the following example the address of __reset routine is dependent on the code before it. So that means to change the address __Reset we have to remove or add some instructions before that. Am I Right?

    .word __Reset ; address of reset routine

    .word DIVIDE_BY_ZERO_TRAP_LABEL ; address of the divide by zero

    ; trap routine

    .org 0x06

    .word 0xffff ; trap routine

    .word 0xffff ; trap routine

    .rept 6

    .word __Default_Interrupt_Handler

    .endr

    .org 1Eh ; Define your Interrupt Vector

    .word WAKE_UP_INT

    .rept 119

    .word __Default_Interrupt_Handler

    .endr

    __reset: ---------------------------

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 11:35

    Yes Sir, you are right !