Keil™, An ARM® Company

C166 User's Guide

Memory Models

The memory model determines the default memory type to use for variables and functions. The C166 Compiler provides seven memory models as shown in the following table:

DirectiveMemory ModelVariable
Addresses
Function
Addresses
TINYTiny Modelnearnear
Up to 64K Code Size
SMALLSmall Modelnearnear
Up to 64K Code Size
MEDIUMMedium Modelnearfar
Unlimited Code Size
COMPACTCompact Modelfarnear
Up to 64K Code Size
LARGELarge Modelfarfar
Unlimited Code Size
HCOMPACTHCompact Modelhugenear
Up to 64K Code Size
HLARGEHLarge Modelhugefar
Unlimited Code Size
XLARGEXLarge Modelxhugefar
Unlimited Code Size

Note

  • You may override the default memory type imposed by the memory model by explicitly declaring a variable or function with a memory type specifier.