Nascom Newsletter |
Volume 3 · Number 4 · December 1983 |
Page 5 of 37 |
---|
may be used. The SYS-EX equivalent of Monitor is to perform warm start to SYS-EX. This may be achieved from BASIC in the following way.
DOKE the SYS-EX warm start entry point into location 4100. The warm start entry point is 000BH beyond the start of SYS-EX. If SYS-EX is installed at B000H, the required BASIC command is
DOKE 4100,-20469 (ie. B00BH = -20469)
BASIC can now be left by calling the USR function. (eg. PRINT USR(0) )
One example of the usefulness of this feature is when a conversion between decimal and hexadecimal is required. In this case, the procedure would be:
DOKE 4100,-20469 + PRINT USR(0)
If you put SYS-EX into EPROM and set the hardware jump to start SYS-EX, then a press of the RESET button will take you straight from BASIC to SYS-EX. As this performs a cold start, the screen will also be cleared.
Now for something for Z80 assembler programmers. An earlier part mentioned that all of the SYS-EX routines may be called from an assembler program. The available routines are all of the keyboard commands plus 9 further commands. All routines are called by calling the same entry point within SYS-EX (3 bytes on from the start of the monitor extension). The byte following the call instruction should contain the required routine number. In the case of the keyboard commands, the routine number is the ASCII code of the lower case letter. Routines start at 61H (“a”). The 9 additional routines are numbered 7BH through 83H.
Parameters required for a called command are set up in the NAS-SYS arguments before the command is called. Commands do not preserve the contents of registers AF, BC, DE, HL, so the user must save any values required. If, on return from calling a SYS-EX routine, the Carry flag is set ON, an error condition has been detected and the command may not have been completed.
The 9 routines which are available only by calling from an assembler program are now described.
Page 5 of 37 |
---|