NMI-F Reboot (booter.B1)

Developer(s): Les Cottrell
Date: 1990
Type: Program
Platform(s): TS 2068
Tags: Utility

Lets an LKDOS version 3 owner reboot from inside any program: after these lines have run, pressing the NMI button and then F selects the boot drive (the RAMdisk in Les Cottrell’s case) and loads its AUTOSTART program. The 65-byte routine is POKEd into the LKDOS RAM at 16100 and hooked to the NMI-F vector; the first number in line 5 picks the drive (2, 4, 8, 16 or 128 for drives 0-4). The lines are numbered to MERGE in front of a boot program; lines 90 and 9000 make it a stand-alone program.

The heart of it comes from the Larken Disk Editor manual. It needs the LKDOS version 3 EPROM, so there is no download. The first DATA value in line 4 is printed as 123, but the annotated code shows 243 (DI).

Published in Sinc-Link March-April 1990 (Did You Know … 2068/Larken Tips).

Source Code

1 RESTORE 4
2 FOR a=16100 TO 16164
3 READ b: RANDOMIZE USR 100:
POKE a,b: NEXT a
4 DATA 123,205,98,0,62
5 DATA 128,50,3,32,0,0,0,0,0,
33,27,63,17,34,32,1,10,0,237,176
,62,11,50,2,32,205,198,0,42,124,
32,34,51,32,42,134,32,34,49,32,2
05,201,0,62,100,251,201,0,0,0
6 DATA 65,85,84,79,83,84,65,8
2,84,32
7 RANDOMIZE USR 100: POKE 821
4,16100
8 BEEP .5,.5: PRINT "NMI-F RE
BOOT ACTIVATED": PAUSE 100:CLS

Stand-alone lines
90 RANDOMIZE USR 100: NEW
9000 RANDOMIZE USR 100: SAVE "bo
oter.B1" LINE 1

How it works
161XX
00 243         DI              :disable intrpt
01 205,98,0    CALL 98         :turn on cartridge
04 62,128      LD A, 128       :select drive 4
06 50,3,32     LD (8195),A
09 0,0,0,0,0                   :delay
14 33,27,63    LD HL,16155     :transfer filename
17 17,34,32    LD DE,8226      :to prognm
20 1,10,0      LD BD,10
23 237,176     LDIR
25 62,11       LD A,11         :set MC load flag
27 50,02,32    LD (8194),A
30 205,198,0   CALL 198        :load name
33 42,124,32   LD HL,(8316)    :destin-start addr
36 34,51,32    LD (8243),HL    :store in temp4
39 42,134,32   LD HL,(8326)    :Totlen-length
42 34,49,32    LD (8241),HL    :store in temp2
45 205,201,0   CALL 201        :second data
48 62,100      LD A,100        :exit cartridge
50 251         EI              :enable intrpt
51 201         RET             :return
52 0,0,0                       :not used
55-64          characters      :AUTOSTART

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.