Larken Load/Save Routines

See all articles from Sinc-Link v6 n1
Author(s): George Chambers, Bob Mitchell
Publication: Sinc-Link
Pub Details: Sinc-Link v6 n1 (Volume 6, Issue 1)
Date: January/February 1988
Pages: 9-10

Bob Mitchell, whose column appears regularly in our newsletter, has sent me some material on a M/C utility for the Larken disk system. We include it in this issue. Bob is presently in Florida, and says in his letter:

“I started off the year with a go at eliminating the need for LDOS64 etc. in my utilities. I had taken a good look at the disassembly of Larry Kenny‘s Move routine and decided I could use some ideas there to do a M/C routine that would meet my needs. I think it might meet yours, and others in the club might find it useful. Since I have no typewriter or big printer I have done a sheet in longhand which I enclose, and which could be printed as is in the club newsletter.” end of quote.

Bob’s routine will be useful for owners of the original Larken system, the one that stores 1960 bytes of data per track. You should also have the This includes most of the Larken owners in our club. The code provides two functions, namely LOAD a track into memory, and SAVE a block of memory to a disk track. When I tried it out on my “DOCTOR” program I found that an additional routine was desirable. One of the routines in “DOCTOR” looks at each track on the disk in succession. Bob’s LOAD routine moved the head back to track 0 every time that a track was read, causing a great deal of unnecessary head movement.

I found another DOS call which eliminated this head movement and rearranged Bob’s code to incorporate this third function. I include a disassembly of it; compare it to the original.

The DOS calls mentioned plus other data are contained in a three-page brochure put out by Larry Kenny. Most LARKEN owners in our club have a copy. If you do not have it and are interested, ask me for a copy.

Since Bob’s explanation may be a bit obscure to non-M/C fans ( I have provided my code in a BASIC program so that you can more easily get it into use. Enter the BASIC program, RUN it. Then save it to disk by PRINT USER 100: SAVE “RHMDOS.C2” CODE 63000,110. The code could be given any name. I suggest that for consistancy you name it as above.

The “reloc8” mentioned in Bob’s article is a BASIC program he has written (and which is in our club program library). It is useful in moving M/C around in memory, while “LDOS64” is the original LARKEN EPROM DOS captured and used as a disk DOS.

  10 RESTORE 200
20 FOR n=63000 TO 63110: READ a: POKE n,a: NEXT n
30 STOP
200 DATA 195,43,246,195,72,246,195,104,246,243
201 DATA 205,98,0,201,58,100,0,251,201,205
202 DATA 33,246,58,176,92,50,29,32,205,126
203 DATA 0,205,123,0,33,112,32,17,16,248
204 DATA 1,192,7,237,176,195,38,246,205,33
205 DATA 246,58,176,92,50,29,32,33,16,248
206 DATA 17,112,32,1,192,7,237,176,205,150
207 DATA 0,205,126,0,205,120,0,195,38,246
208 DATA 205,33,246,205,129,0,205,123,0,33
209 DATA 112,32,17,16,248,1,192,7,237,176
210 DATA 195,38,246,0,0,0,0,0,0,0,0
1000 STOP
63000 C32BF6   JP   63019
63003 C348F6 JP 63048
63006 C368F6 JP 63080
63009 F3 DI
63010 CD6200 CALL 98
63013 C9 RET
63014 3A6400 LD A,(100)
63017 FB EI
63018 C9 RET
63019 CD21F6 CALL 63009
63022 3AB05C LD A,(23728)
63025 321D20 LD (8221),A
63028 CD7E00 CALL 126
63031 CD7B00 CALL 123
63034 217020 LD HL,8304
63037 1110F8 LD DE,63504
63040 01C007 LD BC,1984
63043 EDB0 LDIR
63045 C326F6 JP 63014
63048 CD21F6 CALL 63009
63051 3AB05C LD A,(23728)
63054 321D20 LD (8221),A
63057 2110F8 LD HL,63504
63060 117020 LD DE,8304
63063 01C007 LD BC,1984
63066 EDB0 LDIR
63068 CD9600 CALL 150
63071 CD7E00 CALL 126
63074 CD7800 CALL 120
63077 C326F6 JP 63014
63080 CD21F6 CALL 63009
63083 CD8100 CALL 129
63086 CD7B00 CALL 123
63089 217020 LD HL,8304
63092 1110F8 LD DE,63504
63095 01C007 LD BC,1984
63098 EDB0 LDIR
63100 C326F6 JP 63014
63103 C9 RET

MACHINE CODE for LOADING & SAVING TRACKS

Bob Mitchell 1988

62997 C3  F6
63000 C328F6 JP 63016 LOAD entry point
63003 C345F6 JP 63045 SAVE " "
63006 F3 DI Turn ON Cartridge
63007 CD6200 CALL 98
63010 C9 RET
63011 3A6400 LD A,(100) Turn OFF Cartridge (EXIT)
63014 FB EI
63015 C9 RET
63016 CD1EF6 CALL 63006 LOAD a track routine
63019 3AB05C LD A,(23728) *
63022 321D20 LD (8221),A
63025 CD7E00 CALL 126 get curtrk
63028 CD7B00 CALL 123 load buffer from disk
63031 217020 LD HL,8304 } move buffer data to 63504
63034 1110F8 LD DE,63504 } 1984 bytes moved
63037 01C007 LD BC,1984 }
63040 EDB0 LDIR
63042 C323F6 JP 63011 EXIT
63045 CD1EF6 CALL 63006 SAVE a track routine
63048 3AB05C LD A,(23728) *
63051 321D20 LD (8221),A
63054 2110F8 LD HL,63504 } move buffer data back
63057 117020 LD DE,8304 } to 8304
63060 01C007 LD BC,1984 }
63063 EDB0 LDIR
63065 CD9600 CALL 150 CHECK if PROT sticker
63068 CD7E00 CALL 126 get curtrack
63071 CD7800 CALL 120 SAVE buffer to disk
63074 C323F6 JP 63011 EXIT
F618H  C3 28 F6 C3 45 F6 F3 CD
F620H 62 00 C9 3A 64 00 FB C9
F628H CD 1E F6 3A B0 5C 32 1D
F630H 20 CD 7E 00 CD 7B 00 21
F638H 70 20 11 10 F8 01 C0 07
F640H ED B0 C3 23 F6 CD 1E F6
F648H 3A B0 5C 32 1D 20 21 10
F650H F8 11 70 20 01 C0 07 ED
F658H B0 CD 96 00 CD 7E 00 CD
F660H 78 00 C3 23 F6 00 00 00

* Track # is POKED into 23728 in BASIC line. e.g.

100 LET curtrack=23728
110 LET number=0
120 POKE curtrack,number
130 RANDOMIZE USR 63000: REM to Load

Notes:

1. Use this routine to eliminate need for using disk LDOS’s with LKDOS.

2. This program was developed using Zeus, then relocated to ORG 63000 using “reloc8.”

3. Addresses (e.g. 63504) equate to LDOS64 + 200[illegible]

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