ZX81 LARKEN Drive Select

See all articles from Sinc-Link v5 n2
Author(s): John Thomas
Publication: Sinc-Link
Pub Details: Sinc-Link v5 n2 (Volume 5, Issue 2)
Date: March/April 1987
Pages: 9

The program listing accompanying this article selects either drive 1 or drive 2 for the LARKEN DOS, from any MC storage area in the TS1000 (ZX81) where you can safely place M/C. This can be the 8-16K area (you must have RAM here, either by having the 64K memory or a Hunter board). POKE the M/C provided, beginning with 8192; or above RAMTOP (after establishing a proper RAMTOP by POKEing the necessary numbers in 16388 and 16389 in the TS1000 (don’t forget to NEW), POKE the M/C beginning with the first address of the of the selected RAMTOP; or in a REM statement (generate it first, you will need 18 characters in it, and POKE M/C beginning withb 16514); or any other place suitable for M/C.

Ifthe M/C has been entered beginning with 8192, then the call for drive 2 will be RAND USR 8192, and for drive 1 RAND USR 8205.

If the M/C is in a 1 REM statement then the call for drive 2 will be RAND USR 16514, and drive 1 will be RAND USR 16527.

This program can be used with the 2068 if changes are made regarding the M/C storage areas (address of the M/C storage areas determines where to place and where to call the program). Bytes that are POKEd by the M/C to select the drives in the ZX81 are not the same as for the 2068. These bytes are: 8193- 87 (the port number); 8194- 2 (data for the port); these bytes select drive 2. Bytes 8206- 87, 8207- 0 are likewise the port and data for drive 2. These bytes may have to be changed for the 2068. Check your DOS manual, regarding drive select.

The bytes at 8202- 0 and 8203- 56 call LDOS at 14336, and also may have to be changed if the call is different for the 2068.

I use the program to select the drives; one has utility programs that are all placed at 8192 and all are in M/C. (Use the M/C SAVEing technique of LDOS). Now, I only have to remember one address and I can load as many M/C utilities as I want, one after another from 8192 and no conflict with the resident BASIC program. The second drive is for storage of the BASIC program as I progress (frequent SAVEs prevents suicides among programmers!).

ADDRESS  DEC   HEX   COMMENTS
8192     1     01    Call for Drive #2 (8192)
8193     87    57
8194     2     02
8195     237   ED
8196     67    43
8197     12    0C    Both leave you at the
8198     48    30    entry to DOS.
8199     237   ED
8200     65    41
8201     205   CD
8202     0     00
8303     56    38
8204     201   C9

8205     1     01    Call for Drive #1 (8205)
8206     87    57
8207     0     00
8208     237   ED
8209     67    43    REMEMBER to poke 12304,0;
8210     12    0C    POKE 12305,32; POKE 12306, 26
8211     48    3     and POKE 12307,0  before saving
8212     237   ED    on disk with "Drive.C1"
8213     65    4      whatever name.
8214     205   CD
8215     0     00     This M/C can be located at
8216     56    38     any convenient spot.
8217     201   C9

DRIVE #2 SELECT

1,87,2         Sets up what will be poked in address
               12300 and 12301 of the DOS.
237,67,12,48   POKEs data above into 12300,12301
237,65         Uses data in 12300,12301 to select port.
205,0,56       Enters DOS
201            Return to BASIC

DRIVE #1 SELECT

1,87,0         Sets up what will be poked.
237,67,12,48   Pokes data into addresses
               12300 and 12301
237,65         Uses data in 12300 and 12301 to select port.
205,0,56       Enters LDOS
201            Return to BASIC