Above are found under the "SYMBOL TABLE OF MODULE" section of my generated map file. Question 1From the L251 user guide it is said that "the first 32 bytes of DATA memory (0x00-0x1F) is grouped into 4 banks of 8 registers each"Is it safe to assume then that REGSYM symbols above are in the DATA memory area?If yes, then how come it isnt explicitly written in the mapfileIf no, should I consider it a "linker symbol" then?Question 2What are LINE symbols? why some of it are in the ECODE memory class, why some are not indicated in the mapfile?Question 3How about BLOCK and BLOCKEND symbol? Could you explain what are these symbols?
Here are the answers to your questions:
Q1:
dianne__ said:From the L251 user guide it is said that "the first 32 bytes of DATA memory (0x00-0x1F) is grouped into 4 banks of 8 registers each"
This is correct. Only the first 8 registers R9-R7 are banked and are mapped into the data address area between 0x00 and 0x1F (all 4 banks). Please see pages 3.11 - 3.13 of the Intel user manual: www.keil.com/.../8xc251sx_um.pdf
dianne__ said:If yes, then how come it isnt explicitly written in the mapfile
Yes and no. Registers R0-R7 are memory mapped and banked as explained above. R8-R15 are NOT memory mapped and R10/R11 have special meaning (ACC,B)
R5 does not have a memory address. It is the Register R5 of the selected register bank during execution. R15 is anyway not memory mapped. Register banks are allocated as soon as they are used. See your map file:
MEMORY MAP OF MODULE: Measure (MEASURE) START STOP LENGTH ALIGN RELOC MEMORY CLASS SEGMENT NAME ========================================================================= 000000H 000007H 000008H --- AT.. DATA "REG BANK 0" 000008H 00000FH 000008H --- AT.. DATA "REG BANK 1"
Q2:
dianne__ said:What are LINE symbols? why some of it are in the ECODE memory class, why some are not indicated in the mapfile?
The LINE symbols are always in the ECODE or CODE memory class because they represent the address of a C high-level line. Not all C lines generate code. If they do, a corresponding symbol is generated.
Q3:
dianne__ said:How about BLOCK and BLOCKEND symbol? Could you explain what are these symbols?
Such a block defines a range for the scope for variables. This might be a function or additional loops in a function. You can see the nesting level in the map file:
00FF12FAH BLOCK CODE NEAR LAB LVL=1
Thank you very much for the reply. May I ask another one? I missed one representation which I dont know. It is the STKSYMQuestion 1:Is STK the stack symbol?
Question 2: If yes, I read here (http://www.keil.com/support/docs/1157.htm) that STACK is located in the EDATA memory class.Then how come the address of the symbols above are beyond what was declared in CLASSES DIRECTIVE
dianne__ said:Is STK the stack symbol?
Yes. STKSYM is only used with the compiler directive FUNCTIONS(REENTRANT) (see http://www.keil.com/support/man/docs/c251/c251_functions.htm) or when the option 'Generate reentrant functions' is checked in the µVision dialog 'Options for Target - C251'.With this option, all parameters and all local non-register variables are located on the stack (addressed via SPX / DR60)
dianne__ said:If yes, I read here (http://www.keil.com/support/docs/1157.htm) that STACK is located in the EDATA memory class.
Yes, this is correct
dianne__ said:Then how come the address of the symbols above are beyond what was declared in CLASSES DIRECTIVE
The addresses above are stack-relative, not absolute. For example 'test1' has an offset of 0xFFFFFFF9. This is the negative number -7. You will probably see instructions like this in your LST file to address the local variable 'test1':
000004 793FFFFF MOV @DR60-0x7,WR6 ; test1
okay. thank you so much again for answering my questions :)