Miscellaneous useful information
The expanded and non-expanded machine
When a Z88 has 128K or more of RAM in slot 1, it becomes expanded. The latest V4 of the operating system is expanded automatically if internal RAM has been upgraded to 128K or more. For previous versions of the Z88 operating system only the first rule is obeyed. The differences between the expanded and non-expanded computers are as follows:
Property | Expanded | Non-expanded |
---|---|---|
Size of BBC BASIC | 40K | 8K |
Maximum map width | 256 pixels | 96 pixels |
User characters | 64 | 16 (but see below) |
Value of EOF#-1 | -1 | 0 |
Some users will want to use extra memory, for filing for example, without the burden of a 40K BASIC. If all your BASIC programs fit comfortably within the ordinary 8K it is unhelpful to have to carry the extra 32K around, thus using slot 2 or slot 3 to expand the memory does not expand the machine (V3 or earlier operating systems), but just increases memory size (note that using slot 3 for RAM causes a very heavy power drain on the Z88, due to the lack of special power saving hardware in this slot). The unexpanded machine can use 64 user characters, but if an 80 pixel map is used, the last 48 of these will be overwritten by map information when PipeDream is used (or another application that write to the high resolution map). Reducing the map width to 64 pixels, or not using the map at all, allows for free use of all 64 user characters. The file attributes for BASIC's -1 channel ($FFFF) all hold interesting information:
File Handle Function | Output |
---|---|
PTR#-1 | high word = no. of free handles in the system. low word = ROM version code:Â $03 for V2.2 and 3.x versions |
 EXT#-1 |  Free memory. This is an approximation and should be interpreted with care. It is similar to the memory free indicators given by PipeDream and the Diary. |
 EOF#-1 |  -1 = machine is expanded. 0 = standard 32K machine. |
This information can be accessed by applications by using the OS_Frm system call, to read file attributes, and specifying a handle of $FFFF in the IX register pair. Note that although the sequential pointer (PTR) and extent (EXT) are returned as 4 byte values in DE and BC registers, the end of file (EOF) result is returned in Fz, with Fz = 1 indicating the end of file (ie. TRUE or 1) and Fz = 0 otherwise (ie. FALSE or 0).Â
Extra CLI features
<SQUARE> + SÂ Â Â Â Â Â Â Â Â Â Â T-direct output to ":RAM.-/s.sgn".
<SQUARE> + KÂ Â Â Â Â Â Â Â Â Â Â T-direct input to ":RAM.-/k.sgn".
<SQUARE> + PÂ Â Â Â Â Â Â Â Â Â Â T-direct output to :PRT.0
<DIAMOND><LEFT-SHIFT>Â Â Freeze screen output
If there is an EPROM, which contains a file called "boot.cli", present in slot 3 at the time of a reset (soft or hard) then it will be loaded into :RAM.- and executed as a CLI file.
Note: :RAM.-
files are dangerous under the version 2.2 or 3.0 of the operating system - see below for details.Â
Memory for files and applications
Each RAM card is given an allocation of space by the system which is useable by the RAM filing device associated with that slot. This allocation is always less than total RAM available in that card. Applications (and the special device :RAM.-) can use the remaining memory as well as the memory allocated to files. Because of this approach, the values given for free memory are sometimes confusing. The free memory indicators return space available to applications, which will generally be rather less than that available to files.
The device :RAM.-
can use memory from anywhere in the system, and as such is it very useful for large files. Due to a bug in versions 2.2 (3.0) in the operating system, if any files are stored in the device when a soft reset occurs, the system becomes badly confused, and it is very likely that a crash will follow sometime later. If you need to use :RAM.- files, then it is vital that they are deleted immediately after use. The features described in the previous section all use :RAM.-
and if these operations are used, then the files generated should be deleted at the first opportunity.
NOTE: V4 and later ROM version has fixed the :RAM.-
problem. Some foreign V3.xx versions contains the fix as well. You will probably be aware of this on your own Z88.Â
Â
PipeDream format
The PipeDream file format is designed to facilitate manipulation by other programs. No control characters, or characters above ASCII value 127 are used in the file, unless they have been explicitly typed in (ISO characters), apart from Carriage Return (CR) characters which are used as separators. The files are sequential, and can be edited by any text editor.
PipeDream uses a special form of construct to add special information about the structure of the file. All constructs begin and end with an ASCII percent sign '%'. Immediately after the first percent sign come one or more alphabetic characters which identify the construct. Between these characters and the final percent sign, can come any information which is relevant to the construct.
At the start of the file is a group of constructs that identify what the values of Options Page Parameters are for the file. This is followed by the main body of the file.
Each column in the file is preceeded by a column construct which gives details about the column followed by all the slots in the column. Every slot that is defined in that column has an entry.
Each entry is separated from the next one with a CR character. On each line there can be a collection of constructs giving details about the slot.
For each column in the file there is a column construct, followed by all the entries for that column, until the end of file.
Options Page construct
%OP%parameter value CR
parameter  two characters identifying the parameter
value      the value of the parameter
CRÂ Â Â Â Â Â Â Â Â Carriage Return ($0D)
The various parameter values are:
AMÂ Â Â Â Â Â Â Â Â Auto/manual
BMÂ Â Â Â Â Â Â Â Â Bottom margin
BOÂ Â Â Â Â Â Â Â Â Borders
DEÂ Â Â Â Â Â Â Â Â Title
DPÂ Â Â Â Â Â Â Â Â Decimal places
FMÂ Â Â Â Â Â Â Â Â Footer margin
FOÂ Â Â Â Â Â Â Â Â Footer
HEÂ Â Â Â Â Â Â Â Â Header
HMÂ Â Â Â Â Â Â Â Â Header margin
IWÂ Â Â Â Â Â Â Â Â Insert on wrap
JUÂ Â Â Â Â Â Â Â Â Justify
LMÂ Â Â Â Â Â Â Â Â Left margin
LPÂ Â Â Â Â Â Â Â Â Leading characters
LSÂ Â Â Â Â Â Â Â Â Line spacing
MBÂ Â Â Â Â Â Â Â Â Minus/Brackets
PAÂ Â Â Â Â Â Â Â Â Pages
PLÂ Â Â Â Â Â Â Â Â Page length
PSÂ Â Â Â Â Â Â Â Â Page start no.
RCÂ Â Â Â Â Â Â Â Â Rows/Columns
TMÂ Â Â Â Â Â Â Â Â Top margin
TNÂ Â Â Â Â Â Â Â Â Text/Numbers
TPÂ Â Â Â Â Â Â Â Â Trailing characters
WRÂ Â Â Â Â Â Â Â Â Wrap
Column constructÂ
%CO: column, width, wrap-width%
column     letter identifying the column, eg. A
width      decimal number giving the column width
wrap-width decimal number giving the wrap-width
These constructs can appear anywhere in the entry for each slot:
%B%Â Â Â Â Â Â Â Â bracket format
%C%Â Â Â Â Â Â Â Â centre format
%Dn%Â Â Â Â Â Â Â decimal places. n gives the number
%DF%Â Â Â Â Â Â Â floating format
%F%Â Â Â Â Â Â Â Â free align
%Hn%Â Â Â Â Â Â Â highlight character: n gives the number (1 to 8)
%JL%Â Â Â Â Â Â Â justify left
%JR%Â Â Â Â Â Â Â justify right
%L%Â Â Â Â Â Â Â Â left align
%LC%Â Â Â Â Â Â Â leading character format
%LCR%Â Â Â Â Â Â LCR align
%Pn%Â Â Â Â Â Â Â page break: n gives the argument, 0 for unconditional
%PC%Â Â Â Â Â Â Â per cent character
%R%Â Â Â Â Â Â Â Â right align
%TC%Â Â Â Â Â Â Â trailing character format
%V%Â Â Â Â Â Â Â Â slot is a number slot
General formatÂ
construct text construct text ... CR
construct  one of the constructs above
text       ASCII characters being the slot contents
CRÂ Â Â Â Â Â Â Â Â Carriage Return ($0D)
Diary format
Each day the diary uses (an active day) is headed by a date. This date is in the form:
%dd,mm,yyyy
The % character is represented as %%
The remainder of a diary file is simply straight text.Â