Keil Logo

ROM Compiler Directive

Abbreviation

None.

Arguments

(SMALL), (COMPACT), (LARGE), (D512K), or (D16M)

Default

ROM (LARGE)

µVision

Options — Target — Code ROM Size.

Description

You use the ROM directive to specify the size of the program memory. This directive affects the coding of the JMP and CALL instructions.

Option Description
SMALL CALL and JMP instructions are coded as ACALL and AJMP. The maximum program size may be 2 KBytes. The entire program must be allocated within the 2 KByte program memory space.
COMPACT CALL instructions are coded as LCALL. JMP instructions are coded as AJMP within a function. The size of a function must not exceed 2 KBytes. The entire program may, however, comprise a maximum of 64 KBytes. The type of application determines whether or not ROM (COMPACT) is more advantageous than ROM (LARGE). Any code space saving advantages in using ROM (COMPACT) must be empirically determined.
LARGE CALL and JMP instructions are coded as LCALL and LJMP. This allows you to use the entire address space without any restrictions. Program size is limited to 64 KBytes. Function size is also limited to 64 KBytes.
D512K
(Dallas 390& variants)
19-bit ACALL and AJMP instructions are generated. The maximum program size may be 512 KBytes. This mode is available only for the Dallas 390 and compatible devices.
D16M
(Dallas 390& variants)
24-bit LCALL instructions and 19-bit AJMP instructions are generated. The maximum program size may be 16MBytes. This mode is available only for the Dallas 390 and compatible devices.

Note

  • The D512K and D16M options require the OMF2 directive.
See Also

COMPACT, LARGE, SMALL

Example
C51 SAMPLE.C ROM (SMALL)

#pragma ROM (SMALL)
  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.