2003-10-30 10:09 PM
2011-05-17 02:35 AM
where is __reset ,__halt , used in crtbegin.spp file,defined ? Where can i change their values?
2011-05-17 02:35 AM
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. Ritu2011-05-17 02:35 AM
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: ---------------------------2011-05-17 02:35 AM
Yes Sir, you are right !