<!-- PDF page 213 -->

```
80 PRINT CHR$(PEEK(30000+f));
   :REM print the l first
   bytes you stored in memory
90 NEXT f
80 CLOSE # 8
```

### Installable device drivers and Driver Channels

As mentioned in the previous chapter, *NextZXOS* allows for installable device drivers. A maximum of 4[^p213-5] of those can be installed.

These are mainly intended for use as software that allows access to external or internal peripherals such as printers, mice, network devices etc, but can also be used for other purposes, such as a potential **NUL** driver which does nothing. (The notion of a device that does nothing is a bit peculiar but it has its uses in computing!). As mentioned in *Chapter 19*, to install or uninstall a driver, you need to use the following dot commands respectively:

**.install** *drivername*\
**.uninstall** *drivername*

where *drivername* is the name of the file which contains the code for each driver. For example the WiFi driver for the ESP chip that your ZX Spectrum Next may have come with or you may have installed yourself is **espat.drv**.

The documentation that comes with the driver will describe how to use it. Some drivers for example may make use of the new **DRIVER** command. This has the following form:

<b>DRIVER</b> <i>driverid, callid [,n1[,n2]] [</i><b>TO</b> <i>var1[,var2[,var3]]]</i>

where *n1* and *n2* are optional values to pass to the driver, and *var1*, *var2* and *var3* are optional variables to receive results from the driver call. The individual **DRIVER** commands that you can use, depend on each device driver and they will also be in the driver's accompanying documentation.

#### Driver Channel support

Some drivers can support input/output via streams and the Driver Channel **d**. If so, the documentation will describe the exact format it supports. Generally speaking however, in order to open a stream to channel **d**, you will be using one of the following command variants (assuming the driver id is ASCII **X**):

```
OPEN #8,"d>X"
```

which opens stream **#8** to simple driver channel for device **X**.

```
OPEN #8,"d>X>string"
```

which opens stream **#8** to channel **d** as described by **string** on device **X**.

```
OPEN #8,"d>X,p1"
```

which opens stream **#8** to channel **d** as described by numeric value **p1** on device **X**.

```
OPEN #8,"d>X,p1,p2"
```

which opens stream **#8** to channel **d** as described by numeric values **p1** and **p2** on device **X**.

[^p213-5]: *This number may change in subsequent versions of NextZXOS*

