Microchip Technology SW006021-1N 사용자 설명서
MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 288
2012 Microchip Technology Inc.
The load address, which is often the same as the link address, is the address at which
the psect will start within the output file (HEX or binary file etc.). If a psect is used to
hold bits, the load address is irrelevant and is instead used to hold the link address (in
bit units) converted into a byte address.
the psect will start within the output file (HEX or binary file etc.). If a psect is used to
hold bits, the load address is irrelevant and is instead used to hold the link address (in
bit units) converted into a byte address.
The Length of the psect is shown in the units used by that psect.
The Selector is less commonly used and is of no concern when compiling for PIC
devices.
devices.
The Space field is important as it indicates the memory space in which the psect was
placed. For Harvard architecture machines, with separate memory spaces (such as the
PIC10/12/16 devices), this field must be used in conjunction with the address to specify
an exact storage location. A space of 0 indicates the program memory, and a space of
1 indicates the data memory. See Section 6.4.9.3.13 “Space”.
placed. For Harvard architecture machines, with separate memory spaces (such as the
PIC10/12/16 devices), this field must be used in conjunction with the address to specify
an exact storage location. A space of 0 indicates the program memory, and a space of
1 indicates the data memory. See Section 6.4.9.3.13 “Space”.
The Scale of a psect indicates the number of address units per byte. This is left blank
if the scale is 1 and will show 8 for psects that hold bit objects. The load address of
psects that hold bits is used to display the link address converted into units of bytes,
rather than the load address. See Section 6.4.9.3.2 “Bit”.
if the scale is 1 and will show 8 for psects that hold bit objects. The load address of
psects that hold bits is used to display the link address converted into units of bytes,
rather than the load address. See Section 6.4.9.3.2 “Bit”.
For example, the following appears in a map file.
Name Link Load Length Selector Space Scale
ext.obj text 3A 3A 22 30 0
bss 4B 4B 10 4B 1
rbit 50 A 2 0 1 8
This indicates that one of the files that the linker processed was called ext.obj. (This
may have been derived from C code or a source file called ext.as.)
may have been derived from C code or a source file called ext.as.)
This object file contained a text psect, as well as psects called bss and rbit.
The psect text was linked at address 3A and bss at address 4B. At first glance, this
seems to be a problem given that text is 22 words long; however, they are in different
memory areas, as indicated by the space flag (0 for text and 1 for bss), and so do not
occupy the same memory.
seems to be a problem given that text is 22 words long; however, they are in different
memory areas, as indicated by the space flag (0 for text and 1 for bss), and so do not
occupy the same memory.
The psect rbit contains bit objects, and this can be confirmed by looking it the scale
value, which is 8. Again, at first glance there seems there could be an issue with rbit
linked over the top of bss. Their space flags are the same, but since rbit contains bit
objects, its link address is in units of bits. The load address field of rbit psect displays
the link address converted to byte units, i.e., 50h/8 => Ah.
value, which is 8. Again, at first glance there seems there could be an issue with rbit
linked over the top of bss. Their space flags are the same, but since rbit contains bit
objects, its link address is in units of bits. The load address field of rbit psect displays
the link address converted to byte units, i.e., 50h/8 => Ah.
Underneath the object file list there may be a label COMMON. This shows the contri-
bution to the program from program-wide psects, in particular that used by the compiled
stack.
bution to the program from program-wide psects, in particular that used by the compiled
stack.
7.4.2.3
PSECT INFORMATION LISTED BY CLASS
The next section in the map file shows the same psect information but grouped by the
psects’ class.
psects’ class.
This section is heralded by the line that contains the headings:
TOTAL Name Link Load Length
Under this are the class names followed by those psects which belong to this class, see
Section 6.4.9.3.3 “Class”. These psects are the same as those listed by module in the
above section; there is no new information contained in this section, just a different
presentation.
Section 6.4.9.3.3 “Class”. These psects are the same as those listed by module in the
above section; there is no new information contained in this section, just a different
presentation.