Chapter
11
I
Technical Information
User Installed Devices
When writing device drives to use with BASIC, note the follow-
ing rules:
0
BASIC sends only a carriage return as an end of line.
If
the
device requires a line feed also, you must provide for this in
your driver.
BASIC must read and write control information
to
the device.
Reading and writing Device Control data is handled by the
BASIC IOCTL statement and the IOCTL$ function.
0
Your driver must provide the following control functions:
The driver must set a maximum line width as requested by
the
OPEN
statement.
The driver must return the current maximum line width
when BASIC asks for it.
Input Devices must return an “end-of-file’’ condition to
BASIC if you want to be able to close sequential input files
open to the device driver. This
is
used by the
EOF
statement.
Input Devices should return a
“.Z
[CTRL]
[q
if BASIC attempts
to
read past the end of the device input stream. BASIC uses
this to give an “Input past end” error.
For more information on device drives, see the
Programmer’s
Reference
Manual for your computer. It is available at your Radio
Shack Computer Store.
Information for Creating Child Processes
When writing programs for use as child processes from BASIC,
please note the following rules and information:
Child processes that use the screen device might modify the
screen mode parameters.
If
necessary, restore these parame-
ters from BIOS.
0
Save and restore interrupt vectors the child process uses.
BASIC places many hardware devices in specific states.
These devices include an Interrupt Controller, Counter Tim-
ers, DMA Controller,
I/O
Latch, and Uarts.
361