Keil Logo

REGUSE Assembler Directive




REGUSE function (register | range 〚, register | range〛)






The REGUSE directive specifies which registers are modified by the specified function. The function specified must match the symbol name used in a PUBLIC definition.

The registers specified by the REGUSE directive are used by global register optimization to improve the performance of C functions that call assembler routines.

The registers that may be specified are:

  • R0-R15, WR0-WR30, DR0-DR28 (CPU registers),
  • DPTR (combined DPH+DPL), DPL, DPH, DPX,
  • A, B (alternative names for R10, R11),
  • C (for the carry flag),
  • ZN (for the zero + negative flag),
  • F0 (for F0 flag),
  • PSW, PSW1 (for the Processor Status Word).

The range specifies a range of registers such as R1-R4.


  • Refer to Interfacing C Programs to Assembler in the C251 User's Guide. The section Register Usage contains additional information about the registers that can be altered in assembler routines.
  • The assembler does not verify the registers used in a routine. Make certain you are careful to specify the correct set of registers used. Failure to do so will result in run-time problems (due to overwritten register values).
  • The function name specified must exactly match the spelling and case of the identifier defined in the assembly source file. If the CASE directive was not specified, identifiers are converter to uppercase.
See Also


$REGUSE function (R1-R6, A, B, C)
  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.