We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I am using Keil Evaluation copy, and for the first time. I am well conversant with other C-Compiler for 8051 family. I want to disable the startup code generated by the compiler. I have opened a new project, and disabled the option to load the startup code. But, at the address 0000, it puts the code to Jump to another small startup routine which does some initialization and initializes the stack. I do not want this code to be generated at all. I know it sounds crazy "not to have a startupcode", but the requirement is such that I do not want the startup code at all. My requirement is: 1. My C program must start at Location 4000h. 2. Not a single line of code/instruction between 0000h to 3fffh. 3. Initailizations such as memory clearing, or Stack initializations,etc must not be done at all, even by the program starting at 4000h. Thanking You, Mr. Kiran V. Sutar.
On the Options for target pane do the following: Target Tab: Don't check the Use On-Chip stuff. Select Off chip code and enter 0x4000 for a start address, 0xFBFF for the end (you don't want to clobber the IAP) C51 Tab: Specify the interrupt vectors at 0x4000. Startup.A51: Modify the program origin (CSEG AT 0) to read CSEG AT 04000H. Other than that, just compile and link your program normally, including the startup code. When I did it, I needed to write my own boot loader. The boot loader, located in the first flash page, was written the same way with the origin at address 0x0100. I wrote an assembly module that handled the routing of all interrupts by:
IntVect Macro Num CSEG AT 8*Num+3 Jb InBoot,$+6 Ljmp 4000H+(8*Num+3) Ajmp 0100H+(8*Num+3) Endm IntVect 0 ; INT0 - External Interrupt IntVect 1 ; T0 - Timer 0 Interrupt IntVect 2 ; INT1 - External Interrupt IntVect 3 ; T1 - Timer 1 Interrupt IntVect 4 ; SP - Serial Port Interrupt IntVect 5 ; T2 - Timer 2 Interrupt IntVect 6 ; PCA - Programmable Capture Array Interrupt
I just noticed that you are using an Evaluation version. I don't think it supports the address range you want. If you purchase the full product, the job is not too difficult.
http://www.keil.com/demo/limits.htm