Keywords: sdccman

## 4.7.11 Memory Models

The following memory models are supported by the PIC16 port:

- small model
- large model

Memory model affects the default size of pointers within the source. The sizes are shown in the next table:

Pointer sizes according to memory model | small model | large model
code pointers | 16-bits | 24-bits
data pointers | 16-bits | 16-bits

It is advisable that all sources within a project are compiled with the same memory model. If one wants to override the default memory model, this can be done by declaring a pointer as far or near. Far selects large memory model's pointers, while near selects small memory model's pointers.

The standard device libraries (see 4.7.8) contain no reference to pointers, so they can be used with both memory models.