cancel
Showing results for 
Search instead for 
Did you mean: 

where is __reset mapped?

kapil
Associate II
Posted on October 31, 2003 at 07:09

where is __reset mapped?

4 REPLIES 4
kapil
Associate II
Posted on May 17, 2011 at 11:35

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

ritu
Associate II
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
kapil
Associate II
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: ---------------------------

ritu
Associate II
Posted on May 17, 2011 at 11:35

Yes Sir, you are right !