SW500008 Microchip Technology, SW500008 Datasheet - Page 87

PICC-18 STD

SW500008

Manufacturer Part Number
SW500008
Description
PICC-18 STD
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC18r
Datasheets

Specifications of SW500008

Supported Families
PIC18
Core Architecture
PIC
Software Edition
Standard
Kit Contents
Software And Docs
Mcu Supported Families
PIC18
Tool Function
Compiler
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
PIC18 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
015
778-1001
778-1001
C Language Features
haves like a C statement, however each instruction must be encapsulated within an asm() statement.
The following example shows both methods used to rotate a byte left through carry:
When using in-line assembler code, great care must be taken to avoid interacting with compiler-
generated code. If in doubt, compile your program with the PICC18 -S option and examine the
assembler code generated by the compiler.
3.12 Preprocessing
All C source files are preprocessed before compilation. Assembler files can also be preprocessed if
the -P command-line option is issued.
3.12.1 Preprocessor Directives
HI-TECH PICC-18 STD accepts several specialised preprocessor directives in addition to the stan-
dard directives. All of these are listed in the table below.
the ## sequence to concatenate tokens.
The asm() statement is used to embed a single assembler instruction. This form looks and be-
Macro expansion using arguments can use the # character to convert an argument to a string, and
You should not use a #asm block within any C constructs such as if, while, do etc.
In these cases, use only the asm("") form, which is a C statement and will correctly
interact with all C flow-of-control structures.
unsigned char var;
void main(void){
#asm
#endasm
}
var = 1;
movlb (_var) > > 8
rlcf (_var)&0ffh,f
asm(“movlb (_var)> >8”);
asm(“rlcf (_var)&0ffh,f”);
// like this...
Preprocessing
73

Related parts for SW500008