Abbreviation |
None. |
Arguments |
(SMALL), (COMPACT), or (LARGE) |
Default |
ROM (LARGE) |
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. |
See Also |
SMALL, COMPACT, LARGE |
Memory Size |
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. |
Example
#pragma ROM (SMALL)