System Calls Reference

The following section is a complete reference of all the Z88 operating system calls. This brief list of topics is intended to make it easier to find a system call to perform the required function. The calls are listed in alphabetical order in the main body of System calls Reference.

Many of the available calls were designed for use by the system and are of no help to the application author. Such calls are marked "Internal operating system usage". Some of the more esoteric calls will not work in all segments, where segment 3 is considered to be the most reliable. If you have some very bizarre bugs you may want to suspect a system call is not working to specifications. Where bugs are known about, or strongly suspected, this information is included with the system call specification. Feel free to contact us if you have discovered new information about OZ.

DC (director) calls are very low level, hence only three of the sixteen available are of use to applications. OS (operating system) calls are more reliable, but because of their power, they'r easily able to disrupt the system - many are not for application use at all. The GN (general) calls are safe and used for applications in that they are unlikely to corrupt the system, but a little unreliable.

Alarms

OS_Alm, alarm manipulation (OZ usage)
GN_Aab, allocate alarm block
GN_Alp, process an expired alarm
GN_Fab, free alarm block
GN_Gab, get first alarm block
GN_Lab, link an alarm block into the alarm chain
GN_Uab, unlink an alarm block from the alarm chain

Application

DC_Nam, Name current application
OS_Poll, poll for an application (OZ usage)
DC_Pol, poll for card usage (extended API in OZ 4.6 and newer)
OS_Ent, enter an application (OZ usage)
DC_Ent, enter new application (low level OZ usage)
OS_Exit, exit an application (OZ usage)
DC_Bye, exiting current application (OZ usage)
OS_Bye, exit application
OS_Stk, stack current process / application (OZ usage)
OS_Uash, Update application static handle in stacked process environment (OZ usage, OZ 4.6 and newer)
OS_Use, process card usage (OZ usage)

Arithmetic

GN_D16, 16bit unsigned division
GN_D24, 24bit unsigned division
GN_Gdn, convert an ASCII string to a binary number
GN_M16, 16bit unsigned multiplication
GN_M24, 24bit unsigned multiplication
GN_Pdn, write number as decimal ASCII string
FP_ Floating point arithmetic

Binding

OS_Mgb, get old bank binding
OS_Mpb, set (put) new bank binding
OS_Fc, fast code (bank binding)
OZ_Mgb, get old bank binding (OZ V4.1 and newer)
OZ_Mpb, set new bank binding (OZ V4.1 and newer)

Characters

GN_Cls, classify a character
GN_Skc, skip character
GN_Skd, skip to delimiter
GN_Skt, skip to value

CLI

DC_Icl, invoke new CLI
DC_In, read from CLI
DC_Xin, examine CLI input
DC_Rbd, rebind streams in CLI layer
OS_Cli, CLI interface (OZ usage)

Close

GN_Cl, close file
OS_Cl, internal close (OZ usage)
GN_Flc, close filter
OS_Mcl, close (free) memory pool
GN_Wcl, close wildcard handler

Dates

GN_Gdt, convert ASCII to internal date
GN_Dei, convert zoned format date to internal format
GN_Die, convert internal format date to zoned format
GN_Gmd, get (read) machine date in internal format
GN_Ldm, Country localized date manipulation (OZ 4.5 and newer)
GN_Pdt, write internal date as ASCII string
GN_Pmd, put (set) machine date

Delay

OS_Dly, fixed time delay

DOR manipulation

OS_Dor, DOR interface

Executable and Linkable Format (ELF)

DC_Elf, ELF low level interface (OZ usage, OZ 5.0 and newer)
DC_Rte, return from ELF (OZ usage, OZ 5.0 and newer)
GN_Elf, enter ELF program (OZ 5.0 and newer)

Errors

GN_Err, display system error box
GN_Esp, return an extended pointer to a system error message
OS_Erc, get error context
OS_Erh, set error handler
OS_Esc, examine special condition

Extended addresses

OS_Bhl, copy bytes from extended address
GN_Cme, compare null-terminated strings, one local, one extended
GN_Rbe, read byte at extended address
GN_Wbe, write byte at extended address
OS_Bde, copy bytes to extended address

File and stream operations

GN_Opf, file or stream open
GN_Cl, close file
GN_Del, delete a file from memory
GN_Ren, rename file
OS_Cl, internal close (OZ usage)
OS_Del, file delete (OZ usage)
OS_Frm, file read miscellaneous
OS_Fwm, file write miscellaneous
OS_Gb, get byte from file (or device)
OS_Gbt, get byte from file (or device) with timeout
OS_Mv, move bytes between stream and memory
GN_Crc, get CRC–32 of open file (OZ V4.5 and newer)
OS_Op, internal open (OZ usage)
OS_Pb, write byte to file, device
OS_Pbt, write byte to file, device with timeout
OS_Ren, file rename (OZ usage)

Serial port stream operations

OS_Pb, write byte to serial port device (IX handle)
OS_Pbt, write byte to serial port device (IX handle), with timeout
OS_Gb, get byte from serial port device (IX handle)
OS_Gbt, get byte from serial port device (IX handle) with timeout
OS_Si, low level serial port interface

Filenames

GN_Esa, read & write to filename segments
GN_Fcm, produce compressed filename
GN_Fex, expand a filename
GN_Opw, open wildcard handler
GN_Pfs, parse filename segment
GN_Prs, parse filename
GN_Wcl, close wildcard handle
GN_Wfn, fetch next match for wildcard string (handle)
GN_Wsm, match filename segment to wildcard string

Filters

GN_Flo, open a filter
GN_Flc, close filter
GN_Flf, flush filter
GN_Flr, read from filter
GN_Flw, write character to filter
GN_Fpb, push back into filter

Handles

OS_Fn, handle functions (OZ usage, extended API in OZ 4.6 and newer)
OS_Gth
, get tri-handle (OZ usage)
OS_Vth, verify tri-handle (OZ usage)
OS_Fth, free tri-handle (OZ usage)

Input

GN_Sip, system input line routine
OS_In, wait for character from standard input
OS_Kin, keyboard input (OZ usage, OZ 5.0 and newer)
OS_Pur, purge keyboard buffer
OS_Tin, read character from standard input, with timeout
OS_Xin, examine input

Integer conversion

GN_Gdn, convert an ASCII string to a binary number
GN_Pdn, write number as decimal ASCII string

Linked lists

GN_Xnx, index next entry in a linked list
GN_Xdl, delete an entry from a linked list
GN_Xin, insert an entry into a linked list

Mailboxes

OS_Sr, save & restore

Miscellaneous

OS_Ploz, Poll for running OZ
OS_Off, Switch machine off
OS_Blp, Bleep generation
OS_Sr, Page Wait
GN_Crc, get CRC–32 of ressource (OZ V4.5 and newer)
DC_Upd, Update Operating System (OZ 4.7 and newer)

Persistent Memory Cards

OS_Epr, File Card Interface (extended API in OZ V4.2)
OS_Fep, Flash Card Interface (OZ V4.2 and newer)

Memory

OS_Axm, allocate explicit memory (OZ 4.6 and newer)
OS_Axp
, allocate explicit page (OZ 4.6 and newer)
OS_Bix
, bind in extended address
OS_Box, restore bindings after OS_Bix OS_Fc, select fast code (fast bank switching)
OS_Fma, find memory for allocation (OZ 4.6 and newer)
OS_Fxm, free explicit memory (OZ 4.6 and newer)
OS_Mal, allocate memory (extended API in OZ 4.7 and newer)
OS_Mcl, close memory (free memory pool)
OS_Mfr, free (previously allocated block) memory
OS_Mop, open memory (allocate memory pool)
GN_Crc, get CRC–32 of local memory area (OZ V4.5 and newer)

Open

GN_Opf, open file, device
GN_Flo, open filter
GN_Opw, open wildcard handler
OS_Mop, open memory (pool)

Output

GN_Nln, send newline (CR/LF) to standard output (deprecated)
GN_Soe, write string at extended address to standard output (deprecated)
GN_Sop, write local string to standard output (deprecated)
OS_Bout, write string at extended or local address to standard output (OZ V4.2 and newer)
OS_Hout, write a hexadecimal byte to std. output (OZ 4.5 and newer)
OS_Nln, send newline (CR/LF) to standard output (OZ 5.0 and newer)
OS_Out, write character to standard output
OS_Pout, write embedded string at PC to standard output (OZ V4.2 and newer)
OS_Prt, output character to printer
OS_Sout, write local string to standard output (OZ 5.0 and newer)

Screen

OS_Map, high resolution graphics manipulation
OS_Sr, save & restore screen file
OS_Sci, low level screen hardware interface
OS_Nq, fetch low level window information settings, System parameters
OS_Sp, set Panel and PrinterEd values
GN_Win, Generic Window create interface

Settings, System parameters

OS_Sp, set Panel and PrinterEd values
OS_Nq, read Panel and PrinterEd values (extended API in OZ 4.5 and newer)

Time

GN_Gmt, fetch machine time
GN_Gtm, convert an ASCII string to a time in internal format
GN_Msc, miscellaneous time operations
GN_Pmt, put (set) machine time
GN_Ptm, write internal time as ASCII string
GN_Sdo, send date and time to standard output
OS_Dly, delay a given period

Tokens

OS_Wrt, write token
OS_Wtb, write token base
OS_Wts, write tokenized string (OZ 5.0 and newer)

Wildcards

GN_Opw, open wildcard handler
GN_Wcl, close wildcard handle
GN_Wfn, fetch next match for wildcard string (handle)
GN_Wsm, match filename segment to wildcard string