From Members’ Letters: Data from AERCO LKDOS System

See all articles from Sinc-Link v7 n5
Author(s): Steve Gunhouse
Publication: Sinc-Link
Pub Details: Sinc-Link v7 n5 (Volume 7, Issue 5)
Date: September/October 1989
Pages: 14-16

Here are three pages of data that one of our members, Steven Gunhouse, has been able to glean from his AERCO LKDOS system. It could prove useful to other members interested in working up Larken routines. G.F.C.

For reference purposes, I will send you some information I have been able to determine about the CALLs in LKDOS. The area from 0078 to 00D1 (in my version, possibly more in yours) is dedicated to function calls. Since this device is normally used to keep several versions compatible, I feel safe in saying that probably none of the purposes have changed from one version to any other, and presumably none have been dropped either, though as per the discussion of the routine at 0096, the actual operation may be different.

LKDOS Function Calls

CALL Purpose (as near as I can determine)
0062 Enable Cartridge
0064 BASIC commands (USR 100)
0066 NMI routine (USR 102)
006A Used by channels "lp", "w0", "w1", and "w2"
006C Used by channel "dd"
0078 Write track
007B Read track
007E Select drive and Seek track
0081 Next track
0084 Find name in directory
0087 Copy directory entry to 203A hex
008A Pop String and Check as valid filename
008D Find BASIC terminator (: or ENTER)
0090 Evaluate Unsigned 2-byte integer (in BC on return)
0093 Error Message - Error T
0096 Test Write Protect
0099 De-Allocate name and find free tracks
009C Evaluate String and copy to 2022 hex
009F Call a routine in Spectrum or 2068 ROM
00A2 Add a name to the directory
00A5 Print 3 digit decimal number (000 to 255)
00A8 End of save routine (remove F5s from tracklist, allocate)
00AB Open stream as "dd"
00AE Print a message
00B1 Erase block header
00B4 Set-up block header
00B7 Find a variable
00BA Disable cartridge and turn of drive
00BD CALL MAKE_ROOM (in Spectrum or 2068)
00C0 CALL DELREC (delete line/variable in Spectrum or 2068)
00C3 Print Error Message - Error X
00C6 LOAD File command (sort of)
00C9 something to do with loading a sector in the right place
00CC SAVE File command (sort of)
00CF SAVE File (everything already set up - as used by NMI)

As noted elsewhere, there may be a few other function calls in some different version of LKDOS, but these are all I could clearly identify in the low part of the AERCO V2 cartridge.

Cartridge RAM utilization: (for AERCO V2)

  DEC  HEX  Size Usage
 8192 2000     2 Length remaining in SAVE?
 8194 2002     1 NMI flag (0=BASIC, 1=NMI/AUTOSTART, B=Machine Code, ???
Others?)
 8195 2003     1 Current Drive
 8196 2004     2 Total Length of Save
 8198 2006     2 Start (temporary pointer
 8200 2008     2 Total Length (temporary pointer)
 8202 200A     1 (see 033D, 0DE6)
 8203 200B     ? unused?
 8206 200E     1 (see 03B2)
 8207 200F     ? unused?
 8214 2016     2 User Address - Defined command or NMI
 8216 2018     2 Printer Driver
 8218 201A     2 CHARS - for windows
 8220 201C     1 ?
 8221 201D     1 Track
 8222 201E     1 ?
      201F     1 attempts counter
 8224 2020     1 File Not Found flag
 8225 2021     1 (see 0FAA)
 8226 2022     A File Name
 8236 202C     2 Start Address of save
 8238 202E     2 Length of block/(see 135D)
 8240 2030     1 Keybyte/flag?
 8241 2031     2 Address of directory entry/track pointer
 8243 2033     2 Start of block
 8245 2035     2 Pointer to track number
 8247 2037     1 Flag - last block in save
 8249 2038     1 (see 0A11)
 8249 2039     1 Track number SEEKing
 8250 203A    22 Directory Entry copied here
      2045    18 Track list in Directory entry
 8284 205C     ? Extra space for compressing track list?
 8304 2070  1400 Track Buffer
      2070     1 FF (hex - marks start of data block)
      2071     1 Track number
      2072     A Name
      207C     2 Block Start
      207E     2 Block Length
      2080     1 (see 101A, 1043 - used by RAMDISK routines)
      2081     2 LINE number-1
      2083     1 unused?
      2084     2 VARS / Sides&Tracks
      2086     2 File Length (Total)
      2088  13E2 Data block
      3204   ??? Start of disk name (track 0 only)
      346A     6 unused bytes of block
13424 3470   ??? MERGE Buffer?
      347A     1
      347B     1
      347C     2  These bytes used by window routines?
      347E     1
      347F     ?
      3482     1
      3483     1
      3484     ?
13500 3520   578 MERGE Buffer
14900 3A98     ? unused? (more of MERGE Buffer?)
15200 3B60   300 Character Set for windows (AERCO default)
15968 3E60     ? unused?
      3E7A     1 (see 1769)
      3E7B     ?
      3E7C     2 (see 176C)
      3E7E     ? unused?
16000 3E80    14 Window 0 info
16020 3E94    14 Window 1 info
16040 3EA8    14 Window 2 info
16060 3EBC    14 Current Window info:
 w+0           1 Left of Window
 w+1           1 Top of Window
 w+2           1 Right of Window
 w+3           1 Bottom of Window
 w+4           1 Scroll Count
 w+5           1 X position
 w+6           1 Y position
 w+7           1 (see 1613)
 w+8           2 Screen address of character position
 w+10          1 character width
 w+11          1 Window Number?
 w+12          2?(see 18D0)
 w+14          1 Window Attributes
 w+15          1 not used?
 w+16          1 (see 169C)
 w+17          2?(see 1691)
 w+19          1 (see 1680)
16080 3ED0     8 Character bit pattern?
16088 3ED8     2 unused?
16090 3EDA     1 Printer Width (not counting margin)
16091 3EDB     1 empty
16092 3EDC     1 Line Feed Character (0=none)
16093 3EDD     1 printer detokenize flag
16094 3EDE     1 left margin
16095 3EDF     1 empty
16096 3EE0     1 Printer Interface type
16097 3EE1     1 empty
16098 3EE2     1 sequential file detokenize flag
16099 3EE3     1 empty
16100 3EE4   11C FREE SPACE
16383 3FFF       END OF CARTRIDGE RAM

Please note: lengths given are hexadecimal

Locations marked “(see address)” are the address of a reference to that location as it appears in the AERCO V2 Cartridge. Therefore, these numbers may not be helpful in figuring out the intent of a location.