Keil Logo

REGUSE Assembler Directive

Abbreviation

RU

Arguments

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

Default

None.

µVision

None.

Description

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-R7,
  • DPL,
  • DPH,
  • DPTR (for DPL and DPH),
  • A (for the accumulator),
  • B (for the B register),
  • C (for the carry flag),
  • PSW.

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

Note

  • Refer to Interfacing C to Assembler in the Cx51 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

CASE

Example
$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.