beautypg.com

Table 11, Default storage specifiers – Zilog Z8F0130 User Manual

Page 222

background image

Using the ANSI C-Compiler

UM013037-1212

198

Zilog Developer Studio II – Z8 Encore!
User Manual

memory. */

char * near pn;

/* pn is a pointer to a:

near char : small model

far char : large model

pn itself is stored in near

memory. */

char near * far npf; /* npf is a pointer to a near char,

npf itself is stored in far

memory. */

char rom * near cpn;/* cpn is a pointer to a rom char,

cpn itself is stored in near

memory. */

Default Storage Specifiers

The default storage specifier is applied if none is specified. The default storage specifier
for a given type of data depends on the memory model chosen. See the following table for
the default storage specifiers for each model type.

When the deprecated

–const=ROM

option is selected, the default storage specifier for

const

qualified variables is

rom

in both the small and large models. Zilog recommends

that you use the

rom

keyword to explicitly place a variable in the

rom

address space when

desired, rather than use that deprecated option (see the

Place Const Variables in ROM

sec-

tion on page 87).

Space Specifier on Structure and Union Members Ignored

The space specifier for a structure or union takes precedence over any space specifier
declared for an individual member of the structure. When the space specifier of a member
does not match the space specifier of its structure or union, the space specifier of the mem-
ber is ignored.

For example:

Table 45. Default Storage Specifiers

Function

Globals Locals

String

Const

Parameter
s

Pointer

Small (S)

rom

near

near

near

near

near

near

Large (L)

rom

far

far

far

far

far

far