Discussion Forum

Hex file size ?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
markus laibach
Posted
7-May-2001 00:45 GMT
Toolset
C51
New! 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
Read-Only
Author
Jon Ward
Posted
7-May-2001 03:00 GMT
Toolset
C51
New! RE: Hex file size ?
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

Next Thread | Thread List | Previous Thread Start a Thread | Settings