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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Macro AssemblerHI-TECH C Assembly LanguageThe following is an example showing some executable instructions being placed in the textpsect, and some data being placed in the bss psect.PSECT text,class=CODE,delta=2adjust:goto clear_fredincrement:inc _fredPSECT bss,class=RAM,space=1fred:DS 2PSECT text,class=CODE,delta=2clear_fred:clrf _fredreturnNote that even though the two blocks of code in the text psect are separated by a block in the bsspsect, the two text psect blocks will be contiguous when loaded by the linker. In other words,the inc _fred instruction will be followed by the clrf instruction in the final ouptut. The actuallocation in memory of the text and bss psects will be determined by the linker.Code or data that is not explicitly placed into a psect will become part of the default (unnamed)psect.4.3.8 Assembler DirectivesAssembler directives, or pseudo-ops, are used in a similar way to instruction mnemonicss, but eitherdo not generate code, or generate non-executable code, i.e. data bytes. The directives are listed inTable 4.5, and are detailed below.4.3.8.1 GLOBALGLOBAL declares a list of symbols which, if defined within the current module, are made public. Ifthe symbols are not defined in the current module, it is a reference to symbols in external modules.Example:GLOBALlab1,lab2,lab375

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

Saved successfully!

Ooh no, something went wrong!