beautypg.com

Language extensions, Assigning types, Default memory qualifiers – Zilog Z80380 User Manual

Page 36

background image

Language Extensions

C-Compiler Overview

2–2

UM004001-COR1103

– Support for interrupt functions

– Intrinsic functions are provided for in-line assembly.

Intrinsic functions

- Intrinsic functions are provided for inline assembly, setting

interrupt vectors and enabling and disabling interrupts.

LANGUAGE EXTENSIONS

The Z380 family of processors supports various address spaces that correspond to the differ-
ent types of addressed locations and the method logical addresses are formed. The C-lan-
guage, without extensions, is only capable of accessing data in one memory address space.
The Z380 C-compiler memory extensions allow the user to access data in the Z380 memory
address space, the external I/O address space, or the on-chip I/O address space.

A

SSIGNING

T

YPES

Types are extended by adding memory qualifiers to the front of a statement. These memory
qualifiers are defined with the following keywords:

__MEMORY

assigns the type to the standard Z380 main memory address space.

__EXTIO

assigns the type to the external I/O port address space, through which

peripheral devices are accessed. There may be no allocations in this space, but pointers
to it may be defined and used.

__INTIO

assigns the type to the internal (on-chip) I/O port address space, through

which peripheral devices and system control registers are accessed. There may be no
allocations in this space, but pointers to it may be defined and used.

A derived type is not qualified by memory qualifiers (if any) of the type from where it was
derived. Derived types can be structures, unions and function return types.

E

XAMPLE

:

__INTIO char * ptr;

In the above example ptr is a pointer to char in internal I/O address space. The ptr is
not memory qualified but is a pointer to a qualified memory type.)

DEFAULT MEMORY QUALIFIERS

Default memory qualifiers are applied if no memory qualifiers are specified. In all cases the
default memory qualifier is __MEMORY.