Saravana Santhosh
Saravana Santhosh

Reputation: 197

Understanding Delphi MAP File

Here is the sample of MAP file from my test project...

.......
 .......
 .......
 0001:001EFC14 00000020 C=CODE     S=.text    G=(none)   M=Vcl.CategoryButtons ACBP=A9
 0001:001EFC34 0000284C C=CODE     S=.text    G=(none)   M=Vcl.SysStyles ACBP=A9
 0001:001F2480 000407A8 C=CODE     S=.text    G=(none)   M=Vcl.Styles ACBP=A9
 0001:00232C28 00006998 C=CODE     S=.text    G=(none)   M=MainU ACBP=A9
 0002:00000000 000000B4 C=ICODE    S=.itext   G=(none)   M=System   ACBP=A9
 0002:000000B4 00000008 C=ICODE    S=.itext   G=(none)   M=SysInit  ACBP=A9
 ..... 
 .....

My Unit (MainU) resides from 00232C28 to 00006998. Upto here, the memory address prefix with 0001. Starting from the next unit, it begins 0002 and so on.

What does it mean?

As well, what is 'C=', 'S=' 'G=' 'M=' and 'ACBP = '?

Upvotes: 13

Views: 4900

Answers (3)

Tim Veldhuizen
Tim Veldhuizen

Reputation: 21

According to this Embarcadero docwiki page the A, C and B are for Alignment, Combination and "Big". It seems the page does not explain what the P means. The hex value is a mask, although as far as I can see it doesn't list all values. (The listed values don't allow for an odd value for instance)

Alignment

  • 00 - An absolute segment
  • 20 - A byte-aligned segment
  • 40 - A word-aligned segment
  • 60 - A paragraph-aligned segment
  • 80 - A page-aligned segment
  • A0 - An unnamed absolute portion of storage

Combination

  • 00 - Cannot be combined
  • 08 - A public combining segment

Big (for 16 bit)

  • 00 - Segment less than 64 K
  • 02 - Segment exactly 64K

Upvotes: 1

GJ.
GJ.

Reputation: 10937

It mean that your asm code of your unit MainU start at $00232C28 address and the length of compiled unit is $00006998 bytes.

The segment class (C=) is CODE, defined at beginning of map file.

The segment name (S=) is .text

The segment group (G=) is none.

The segment module (M=) is MainU

The ACBP attribute = A9 mean:

  • Unnamed absolute portion of memory address space
  • A public combining
  • The segment may be larger than 64K

Check also: http://files.mpoli.fi/unpacked/software/programm/general/ss0288.zip/ss0288_4.txt

Upvotes: 8

Andreas Hausladen
Andreas Hausladen

Reputation: 8141

The format is:
SegmentId:StartAddress Length C=SegmentClass S=SegmentName G=SegmentGroup M=ModuleName

The ACBP has something to do with alignment but I can't tell you what the hex numbers mean.

C=CODE: Code-Segment
C=ICODE: Initialization Code-Segment
C=DATA: (initialized) Data-Segment
C=BSS: (uninitialized) Data-Segment
C=TLS: Thread Local Storage

G=(none): No Segment-Group

Upvotes: 15

Related Questions