11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Linker and UtilitiesOperationThe minimum value, min, is preceded by a + sign, if present. It sets a minimum value for thelink or load address. The address will be calculated as described below, but if it is less than theminimum then it will be set equal to the minimum.The link and load addresses are either numbers as described above, or the names of other psectsor classes, or special tokens. If the link address is a negative number, the psect is linked in reverseorder with the top of the psect appearing at the specified address minus one. Psects following anegative address will be placed before the first psect in memory. If a link address is omitted, thepsect’s link address will be derived from the top of the previous psect, e.g.-Ptext=100h,data,bssIn this example the text psect is linked at 100 hex (its load address defaults to the same). The datapsect will be linked (and loaded) at an address which is 100 hex plus the length of the text psect,rounded up as necessary if the data psect has a reloc= value associated with it. Similarly, the bsspsect will concatenate with the data psect. Again:-Ptext=-100h,data,bsswill link in ascending order bss, data then text with the top of text appearing at address 0ffh.If the load address is omitted entirely, it defaults to the same as the link address. If the slash /character is supplied, but no address is supplied after it, the load address will concatenate with theprevious psect, e.g.-Ptext=0,data=0/,bsswill cause both text and data to have a link address of zero, text will have a load address of 0, anddata will have a load address starting after the end of text. The bss psect will concatenate with datafor both link and load addresses.The load address may be replaced with a dot . character. This tells the linker to set the loadaddress of this psect to the same as its link address. The link or load address may also be the name ofanother (already linked) psect. This will explicitly concatenate the current psect with the previouslyspecified psect, e.g.-Ptext=0,data=8000h/,bss/. -Pnvram=bss,heapThis example shows text at zero, data linked at 8000h but loaded after text, bss is linked andloaded at 8000h plus the size of data, and nvram and heap are concatenated with bss. Note herethe use of two -P options. Multiple -P options are processed in order.If -A options have been used to specify address ranges for a class then this class name may beused in place of a link or load address, and space will be found in one of the address ranges. Forexample:97

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!