Is it always important to include the file "startup.a51"? Should anything else be included for it to work properly? Thanks
1)Does this mean that iit is not important to use startup.a51? 2)Or does it mean that it is not important to know its details? 1) it is not "important" it is REQUIRED if you have any C code. 2) I did not know the details for years, never looked. Erik
Thanks...
I can understand the codes that clear memory, but other parts seem rather ambigous As a public service, here are the parts of the standard Keil-supplied STARTUP.A51 that do not involve clearing memory.
CSEG AT 0 ?C_STARTUP: LJMP STARTUP1
MOV SP,#?STACK-1
; This code is required if you use L51_BANK.A51 with Banking Mode 4 ; EXTRN CODE (?B_SWITCH0) ; CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
LJMP ?C_START
END
LJMP ?C_STARTThis code jumps to the start of your C code -- that is, main(). Not quite. C_START is the start of Keil's 'C' runtime startup: this includes, among other things, the code to setup all the values of initialised variables. Once this code has completed, it then jumps to main(). As someone else mentioned earlier, you can step through all this if you want...