SW500008 Microchip Technology, SW500008 Datasheet - Page 71

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
3.6 Functions
3.6.1 Function Argument Passing
The method used to pass function arguments depends on the size of the argument or arguments.
area of the called function. If there are subsequent arguments, these arguments are also passed in the
argument area of the called function. The argument area is referenced by an offset from the symbol
?_function, where function is the name of the function concerned.
W register, with subsequent arguments being passed in the argument area of the called function.
function builds up the variable argument list and passes a pointer to the variable part of the argument
list in btemp. Btemp is the label at the start of the temp psect (the psect used for temporary data).
The function test() will receive the parameter b in its function argument block and a in the W
register. A call:
would generate code similar to:
In this example, the parameter b is held in the memory locations ?_test and ?_test+1.
function or the code used to call a function, it is often helpful to write a dummy C function with the
same argument types as your assembler function, and compile to assembler code with the PICC18
-S option, allowing you to examine the assembler code.
If there is only one argument, and it is one byte in size, it is passed in the W register.
If there is only one argument, and it is greater than one byte in size, it is passed in the argument
If there is more than one argument, and the first argument is one byte in size, it is passed in the
In the case of a variable argument list, which is defined by the ellipsis symbol ..., the calling
Take, for example, the following ANSI-style function:
If you need to determine, for assembler code for example, the exact entry or exit code within a
void test(char a, int b){
}
test( ’a’, 8);
movlw
movff
movlw
movff
movlw
call
08h
wreg,?_test
0h
wreg,?_test+1
061h
(_test)
Functions
57

Related parts for SW500008