EasyManuals Logo
Home>Sinclair>Desktop>ZX Spectrum

Sinclair ZX Spectrum User Manual

Sinclair ZX Spectrum
82 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #56 background imageLoading...
Page #56 background image
Chapter 6
54
(logic ‘0’). If a transition does not occur within the time period then set the CTS
output line to the off state (logic ‘1’), and either try again to receive a byte or give
up.
Receive each data bit on the TX data line, using a fixed time delay to determine
the middle position of each bit. A binary ‘1’ is represented by the off state, and a
binary ‘0’ by the on state. The data byte arrives least significant bit first.
Receive the two stop bits on the TX data line (note that the ZX Interface 1 ROM
only checks for the first one), which are represented by the off state (logic ‘1’).
Set the CTS output line to the off state (logic ‘1’) to signal to the end device not
to send another byte.
It is possible that the end device began transmission of another byte before the
CTS output line was set to the off state. It is therefore necessary to perform a
check for a second byte and to buffer it if there is one. The next call to read a
byte should detect that one is already waiting in the buffer and return it instead
of trying to read another in from the RS232 socket.
The TX data input line should be left in the idle state (logic ‘1’) and the CTS output
line left in the off state (logic ‘1’).
ZX Interface 1 ROM hook codes
The ZX Interface 1 provides access to a core set of its ROM routines via the use of
hook codes. This mechanism was introduced so that routines could be called without
the need to know their actual locations within the ROM, thereby allowing programs to
operate correctly with any future revision of the ROM irrespective of whether the core
routines changed location. Officially, two editions of the ZX Interface 1 ROM were
released, with the second being shipped in all units with a serial number greater than
87315. However, there was also reference to a third edition of the ROM made in
Your Spectrum magazine [3], although this version might never have been publicly
released.
The hook code mechanism is invoked from machine code using a RST $08
instruction, and it is the byte that follows that specifies the hook code number of the
desired routine. There are three hook codes that relate to the RS232 facility, although
one of these was only introduced with the second edition ZX Interface 1 ROM.
Hook code $1D is available in both ROM editions and is used to read in a byte from
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 sets the carry flag if a byte was found and returns it in the A register.
The data is expected at the baud rate specified by system variable BAUD ($5CC3),
and the border will flash during receipt of the byte with the colour specified by system
variable IOBORD ($5CC6). Interrupts are always enabled at the end of the routine
irrespective of whether a byte was read in or not. If the BREAK key is pressed then
BASIC error report L BREAK into program is produced.

Table of Contents

Other manuals for Sinclair ZX Spectrum

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair ZX Spectrum and is the answer not in the manual?

Sinclair ZX Spectrum Specifications

General IconGeneral
BrandSinclair
ModelZX Spectrum
CategoryDesktop
LanguageEnglish

Related product manuals