This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hex file size ?

hy,
where can i find the file size of the compiled project (how much memory of the Target is used )?

markus laibach

  • Check the linker map file (.M51). It includes a table of the physical memory used by your application. DATA memory, CODE memory, and XDATA memory are listed here.

    LINK MAP OF MODULE:  SAMPLE (SAMPLE)
    
         TYPE    BASE      LENGTH    RELOCATION   SEGMENT NAME
         -----------------------------------------------------
    
         * * * * * * *   D A T A   M E M O R Y   * * * * * * *
         REG     0000H     0008H     ABSOLUTE     "REG BANK 0"
         DATA    0008H     0001H     UNIT         ?DT?GETCHAR
         DATA    0009H     0001H     UNIT         _DATA_GROUP_
                 000AH     0016H                  *** GAP ***
         BIT     0020H.0   0000H.1   UNIT         ?BI?GETCHAR
                 0020H.1   0000H.7                *** GAP ***
         IDATA   0021H     0001H     UNIT         ?STACK
    
         * * * * * * *   C O D E   M E M O R Y   * * * * * * *
         CODE    0000H     0003H     ABSOLUTE     
         CODE    0003H     0021H     UNIT         ?PR?MAIN?SAMPLE
         CODE    0024H     000CH     UNIT         ?C_C51STARTUP
         CODE    0030H     0027H     UNIT         ?PR?PUTCHAR?PUTCHAR
         CODE    0057H     0011H     UNIT         ?PR?GETCHAR?GETCHAR
         CODE    0068H     0018H     UNIT         ?PR?_TOUPPER?TOUPPER
         CODE    0080H     000AH     UNIT         ?PR?_GETKEY?_GETKEY
    
    

    To determine the total size of your program, take the starting address of the last thing in CODE memory (0080H -- getkey in this example) and add its size (000Ah). This gives 008Ah which is the length of your program in bytes.

    Jon