beautypg.com

Placement directives, Placement of a variable – Zilog ZUSBOPTS User Manual

Page 192

background image

Language Extensions

UM017105-0511

164

Zilog Developer Studio II – ZNEO™
User Manual

The following values for

vectnum

are supported:

Placement Directives

The ZNEO C-Compiler provides language extensions to declare a variable at an address
and to align a variable at a specified alignment.

Placement of a Variable

The following syntax can be used to declare a global or static variable at an address:

char placed_char _At 0xb9ff; // placed_char is assigned an address

0xb9ff.

far struct {

char ch;

int ii;

} ss _At 0x080eff;

// ss is assigned an address

0x080eff

rom char init_char _At 0x2fff = 33;

// init_char is in rom and initialized to 33

Only placed variables with the

rom

or

erom

storage class specifiers can be initialized. The

placed variables with

near

and

far

storage class specifier cannot be initialized. The unini-

tialized placed variables are not initialized to zero by the compiler startup routine.

ADC
C0
C1
C2
C3
I2C
P0AD
P1AD
P2AD
P3AD
P4AD
P5AD
P6AD

P7AD
PWM_FAULT
PWM_TIMER
RESET
SPI
SYSEXC
TIMER0
TIMER1
TIMER2
UART0_RX
UART0_TX
UART1_RX
UART1_TX

Note:

This manual is related to the following products: