Keil Logo

TINY Compiler Directive

Abbreviation

TY

Arguments

None.

Default

TINY

µVision

Options — C251 Compiler — Memory Model — Memory Model.

Description

This directive implements the TINY memory model. The TINY memory model places all function variables and local data segments in the data memory of the 251 system. This ensures the most efficient access to data objects. The default data pointer size is 2 bytes and refers to near (NDATA / NCONST) space.

Regardless of memory model type, you may declare variables in any of the 251 memory areas except far and huge spaces. However, placing frequently used directives (such as loop counters and array indices) in data or near memory significantly improves system performance.

Note

  • The stack required for function calls is always placed in near memory, refered as memory class EDATA.
  • Always start by using the TINY memory model. Then, as your application grows, you can place large variables and data in other memory areas by explicitly declaring the memory area with the variable declaration or by using the HOLD directive. If your data memory requirements grow, you might use the XTINY memory model. The SMALL, XSMALL or LARGE memory model might be a good choice for applications with huge data requirements .
Example
C251 SAMPLE.C TINY

#pragma 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.