Chapter 6
55
Hook code $1E is available in both ROM editions and is used to write out a byte to the
RS232 socket. It requires that the additional system variables used by the
ZX Interface 1 ROM are already present (these may be created beforehand using hook
code $31), and transmits the byte held in the A register. The data is sent at the baud
rate specified by system variable BAUD ($5CC3) and the border will flash during the
transmission with the colour specified by system variable IOBORD ($5CC6). Interrupts
are always enabled at the end of the routine. If the BREAK key is pressed then BASIC
error report L BREAK into program is produced.
Hook code $34 was introduced in the second edition ROM and is used to open a ‘B’
binary channel. It requires that the additional system variables used by the
ZX Interface 1 ROM are already present (these may be created beforehand using hook
code $31). The channel base address is returned in the DE register pair. If there is not
enough room to create the channel then BASIC error report 4 Out of memory is
produced. This hook code is less likely to be of use than the other two that relate to
the RS232 facility.
For further details about the ZX Interface 1 RS232 routines, refer to the Spectrum
Shadow ROM Disassembly book [4]. Alternatively, online commented assembly listings
for both editions of the ZX Interface 1 ROM are available for free download from
website www.wearmouth.demon.co.uk [5].