 | C251 User's Guide |  |
|
|
| PARM51 Compiler Directive| Abbreviation | P51 | | Arguments | None. | | Default | PARM251 | | µVision | Options — C251 Compiler — Object — C51 argument passing. | | Description | The PARM51 directive specifies that the compiler use the parameter passing conventions of the C51 compiler. This directive is useful when interfacing 251 programs to existing 8051 code. Note - You may switch between C51 and C251 parameter passing conventions any number of times in your source files.
| | See Also | PARM251 | | Example |
#pragma PARM51 /* switch to C51 calling conventions */
extern char *function_51 (char); /* C51 function */
#pragma PARM251 /* switch to C251 calling conventions */
extern char *function_251 (int); /* C251 function */
pragma PARM51 /* switch to C51 calling conventions */
void f51 (char *p) { /* a C51 compatible function */
*p = 0;
}
#pragma PARM251 /* switch to C251 calling conventions */
void main (void) {
char *p;
p = function_51 (0); /* call a C51 function */
p = function_251 (1); /* call a C251 function */
}
|
|
|