Keil Logo Arm Logo

REGPARMS Compiler Directive








Options — C51 — Misc controls.


The REGPARMS directive instructs the compiler to pass up to three function arguments in registers. Parameters that cannot be passed in registers are passed using fixed memory locations. This technique is used in assembly programs to improve speed and reduce memory utilization. It is significantly faster than storing function arguments in memory.


  • You may specify both the REGPARMS and NOREGPARMS directive several times within a source file to compile some functions using register parameters and other functions using the old style of parameter passing. For example:
    #pragma NOREGPARMS      /* Parm passing-old style */
    extern int old_func (int, char);
    #pragma REGPARMS        /* Parm passing-in registers */
    extern int new_func (int, char);
    main  ()  {
            char a;
            int  x1, x2;
            x1 = old_func (x2, a);
            x1 = new_func (x2, a);
  • You may use the NOREGPARMS directive when accessing assembly functions or libraries that were built with older tools.
See Also



Related Knowledgebase Articles

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

ARM’s Privacy Policy has been updated. By continuing to use our site, you consent to ARM’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.

Acquisition of ARM Holdings plc. by SoftBank Group Corp.

We are pleased to inform you that on 5 September 2016, SoftBank Group Corp. acquired ARM Holdings Plc. ARM will continue to operate as an independent business within the SoftBank group.

Any current agreements between ARM Ltd (or other ARM group companies, as applicable) you / your company remain in effect as between the parties, and the parties will continue to be bound by and perform the obligations in such agreements. If you have any queries please direct these to