Upon entry to the user routine, various Z80 registers have
preset values. These values are: HL = value from ARGI, DE =
Value from @RG2, BC = value from ARGS, – SP = OCSFH “within
the NAS-SYS stack. Forty tno bytes are available on the
stack for use by the user routine. Calls to | NAS-SYS
routines or to SYS-EX routines, from within a user routine,
Mill require a number of stack levels to be available.
y
Call user routine eumber 2
Calls a user routine whose execution address has been
stored in the NAS-SYS argument ARG?
The command is identical to the “x"command except that
the argument ARG? is used in place of ARGS.
Call user routine number 5
Calls a user routine whose execution address has been
stored in the NAS-SYS argument ARGIO.
The command is identical to the “x"command except that
the argument ARGIO is used in place of ARGS.
The three user routine calls, ‘x”, ‘y’ and ‘2’, provide an
easy method of attatching individually tailored Commands ta
the monitor. Uniike the NAS-SYS Execute command, these
commands allow a return ta the monitor (SYS-EX) with a single
RET instruction. Also, the “Error? message can be output
under user control by manipulating the carry flag prior to the
RET. The commands are ideally suited. to. calling individual
monitor type functions. e.g. – Display the character
represented by the ASCII code entered as ARGI -, or – Print
screen contents of attatched printer Tt might even be
possible to directly call some of the functions within Basic.
In addition to “x”, “y” and “2”, there is another method
of calling user routines.” The commands “9”, "37s “my “oO” and
“pr, which are not used directly by SYS-EX, all Call a meaory
address 0400H (1K) beyond the start “of SYS-EX “U-e-immediately
after SYS-EX). If you put your owr code here,
these commands can be used in a simlar way to “x”, “y” and
2’. The register values on entry are the same as’ for “x",
ty’ “and “2”. A word of warning here – if you haven’t put any
cade beyond SYS-EX, don’t use “9”, "3”, "m, “a” or “p’ as the
results will be unpredictable.
That completes the description of the keyboard commands. In
the next issue of the magazine we will look at, amongst other
things, how the GK Basic can make use of forty two character
program names.