REGPARMS

Abbreviation

None.

Arguments

None.

Default

REGPARMS

Description

The REGPARMS directive enables the compiler to generate code that passes up to three function arguments in registers. This type of parameter passing is similar to what you would use when writing in assembly and is significantly faster than storing function arguments in memory. Parameters that cannot be located in registers are passed using fixed memory areas.

NOTE

You may specify both the REGPARMS and NOREGPARMS directives several times within a source program. This allows you to create some program sections with register parameters and other sections using the old style of parameter passing. You should use NOREGPARMS to access existing older assembler functions or library files without having to reassemble or recompile them. For example:

#pragma NOREGPARMS /* old method */
extern int old_func (int, char);

#pragma REGPARMS /* new method */
extern int new_func (int, char);

main () {
    char a;
    int x1, x2;
    x1 = old_func (x2, a);
    x1 = new_func (x2, a);
}

See Also

NOREGPARMS

Example
#pragma REGPARMS