All -

I'm using a model-based design environment which auto-generates C code. In this environment, there's a multitude of code-generation settings which can drastically change the look and architecture of the generated code.

I'm trying to come up with a quick way to objectively compare code generation settings in terms of memory usage without actually running the code. The generated code does not use dynamic memory allocation, so all of the memory used is statically allocated, and I think the linker should be able to tell me how much static memory is used.

I've been able to generate a .map file from the linker (I'm using MS Visual Studio 2005), but having trouble understanding it. I haven't been able to find any documentation on the format of the map file. I've included the first 30 or so lines below, which I think contains information about memory segments of local variables among other things. Can someone help me decipher this?


 Timestamp is 4b4f8d2b (Thu Jan 14 14:31:23 2010)

 Preferred load address is 00400000

 Start         Length     Name                   Class
 0001:00000000 0028b752H .text                   CODE
 0002:00000000 000001b4H .idata$5                DATA
 0002:000001b4 00000004H .CRT$XCA                DATA
 0002:000001b8 00000004H .CRT$XCAA               DATA
 0002:000001bc 00000004H .CRT$XCC                DATA
 0002:000001c0 00000004H .CRT$XCZ                DATA
 0002:000001c4 00000004H .CRT$XIA                DATA
 0002:000001c8 00000004H .CRT$XIAA               DATA
 0002:000001cc 00000004H .CRT$XIC                DATA
 0002:000001d0 00000004H .CRT$XIZ                DATA
 0002:000001d8 00025288H .rdata                  DATA
 0002:00025460 00000004H .rdata$sxdata           DATA
 0002:00025464 00000004H .rtc$IAA                DATA
 0002:00025468 00000004H .rtc$IZZ                DATA
 0002:0002546c 00000004H .rtc$TAA                DATA
 0002:00025470 00000004H .rtc$TZZ                DATA
 0002:00025478 0000007cH .xdata$x                DATA
 0002:000254f4 00000028H .idata$2                DATA
 0002:0002551c 00000014H .idata$3                DATA
 0002:00025530 000001b4H .idata$4                DATA
 0002:000256e4 00000542H .idata$6                DATA
 0002:00025c26 00000000H .edata                  DATA
 0003:00000000 000f070cH .data                   DATA
 0003:000f0720 001f1280H .bss                    DATA