??? 08/25/06 19:58 Read: times |
#123052 - What does this mean? |
Hello all,
I'm a beginer in C programming as I've metioned in previous post, so please bear with me. I use uVision IDE to start new project, and it generates a Startup file for me but for LPC family. In order to use it I have to modify the file. I modified the Startup file to fit my MCU. It's Philips 87C785, and I came across some thing that puzzles me. I've looked in Keil manual but couldn't find the answer. Here is modified version. IDATALEN EQU 40H ; the length of IDATA memory in bytes. IBPSTACK EQU 0 ; set to 1 if small reentrant is used. IBPSTACKTOP EQU 03FH+1 ; set top of stack to highest location+1. NAME ?C_STARTUP ?C_C51STARTUP SEGMENT CODE ?STACK SEGMENT IDATA RSEG ?STACK DS 1 EXTRN CODE (?C_START) PUBLIC ?C_STARTUP CSEG AT 0 ?C_STARTUP: JMP STARTUP1 RSEG ?C_C51STARTUP STARTUP1: IF IDATALEN <> 0 MOV R0,#IDATALEN - 1 CLR A IDATALOOP: MOV @R0,A DJNZ R0,IDATALOOP ENDIF IF IBPSTACK <> 0 EXTRN DATA (?C_IBP) MOV ?C_IBP,#LOW IBPSTACKTOP ENDIF MOV SP,#?STACK-1 JMP ?C_START END I know the STARTUP1 section is to clear memory, but the lines in bold I don't understant what it's for, especially the sign < >. What does it mean? Second, do I have to worry about the Stack pointer? There is any chance that I got SP overflow? If coding in assembly I would relocate it to upper memory and assign a certain memory block for it and don't have to worry any more. In this startup file I see that they reserved only 1 by for SP. This worries me a bit because it seems to be too little. Each call to a subroutine takes 2 byte of stack. If it's a nest call then it would take more. Could someone please spend some time clear these thing out for me. Any input will be greatly appreciated. Have a great weekend. Please advise if you think something is not right with the modified version. Best regards, T.L |
Topic | Author | Date |
What does this mean? | 01/01/70 00:00 | |
Not Equal To | 01/01/70 00:00 | |
Not Equal to | 01/01/70 00:00 | |
Manual. | 01/01/70 00:00 | |
Not Equal to | 01/01/70 00:00 | |
SP and STACK | 01/01/70 00:00 | |
Stack | 01/01/70 00:00 | |
Sorry | 01/01/70 00:00 | |
Stack of names and STACK | 01/01/70 00:00 | |
notation | 01/01/70 00:00 | |
Stack | 01/01/70 00:00 | |
yes and no and no | 01/01/70 00:00 | |
Stack![]() | 01/01/70 00:00 |