Memory Map & Technical Details

For the advanced user, here is a summary of some technical details of Z88 CamelForth v3.00. Note that these are version-specific, and subject to change.


Memory Map

Z88 CamelForth divides the memory space of the Z88 into the following areas:

$0000-$1FFF
OZ system usage and data stack
$2000-$24FF
CamelForth dynamic data (detailed later)
$2500-$3FFF
RAM region
$4000-$7FFF
RAM/ROM1 regions
$8000-$BFFF
RAM/ROM2 regions
$C000-$FFFF
CamelForth application

CamelForth Dynamic Data

The area from $2000-$24FF is used as detailed below. If you know your application won't be using a particular area, you can allocate it either by simply having a constant point to it, or by using RAM DP ! to alter the RAM region pointer, doing some allocations, and then using RAM DP ! to reset the pointer.

$2000-$20E4
Far memory allocation structures.
$20E5-$217F
Internal "user" variables.
$2180-$21A1
Pictured numeric output area (34 bytes).
$21A2-$21F5
PAD (84 bytes).
$21F6-$22AF
Return stack (93 cells).
$22B0-$22FF
TIB (80 bytes).
$2300-$23FF
0PAD - used for filenames and other OZ stuff (256 bytes).
$2400-$247F
File line input area (128 bytes).
$2480-$24FF
Interpretive string scratch space (128 bytes).

Register Usage

The Z80 registers are used as follows, and must be preserved. Unmentioned registers may be used freely and are not preserved by any words.

BC
Top of data stack (TOS).
DE
Interpretive pointer (IP).
SP
Data stack pointer (PSP).
IX
Return stack pointer (RSP).
IY
User pointer (UP).

More about CamelForth

Back to the Z88 home page