beautypg.com

Placement directives – Zilog EZ80F916 User Manual

Page 162

background image

UM014423-0607

Using the ANSI C-Compiler

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

142

}

}

}
}

In summary, setting up interrupts is somewhat complex on the eZ80

®

family as there are a

number of things to configure, such as the I register, the long and short jump tables, and so
on. Because the eZ80F92 and eZ80F93 only have two byte addresses for the default inter-
rupt vectors, you need to set up other jump tables to bridge the gap into the 24-bit world
when using those CPUs. The other thing to keep in mind is that the I register controls the
upper 8 bits of this default interrupt vector, allowing you to move the overall interrupt
jump table anywhere in the 64K range.

Placement Directives

The eZ80 Acclaim! C-Compiler provides language extensions to declare a variable at an
address and to align a variable at a specified alignment. The following sections describe
placement directives:

“Placement of a Variable” on page 142

“Placement of Consecutive Variables” on page 143

“Alignment of a Variable” on page 143

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

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

struct {

char ch;
int ii;

} ss _At 0xB7E110;

// ss is assigned an address 0xB7E110

const char init_char _At 0x1000 = 33;

// init_char is in rom at 0x1000 and initialized to 33

NOTE: Only placed variables with the

const

qualifier can be initialized. Non-

const

placed variables are not re-initialized correctly upon program reset.The
uninitialized placed variables are not initialized to zero by the compiler startup
routine.

This manual is related to the following products: