Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/23/02 18:24
Read: times


 
#27848 - RE: Keil & reset vector
at the beginning of CSTARTUP.a51, there is this line :
EXTRN CODE (?C_START)
At the end, there is this one :
LJMP ?C_START

I understand that C_START has the applicative boot adress...


Not in my C51 package! C_START is a label in init.a51 that starts of a routine that performs any variable initialization that is required. That routine then jumps to INITEND where there is a jump to MAIN.

...but how seize it and how could I specify to the linker to put my main () in my C file to a specified adress (0000h for example).

Copy startup.a51 into your working directory and where you find:
                CSEG    AT      0
?C_STARTUP:     LJMP    STARTUP1

edit it to become:
?C_STARTUP:     LJMP    MAIN

I can understand wanting to start off execution inserting some critical hardware initialization code before the C runtime startup (I've done that when required), but I would not recommend bypassing the C runtime startup entirely!. But, do what you need to do. It doesn't necessarily have to involve linker controls, however.

List of 24 messages in thread
TopicAuthorDate
Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector more            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector            01/01/70 00:00      
RE: Keil & reset vector bat/amake            01/01/70 00:00      
RE: Keil & reset vector bat/amake            01/01/70 00:00      

Back to Subject List