Super Utility Tech Manual Page 1 SU+ TECH MANUAL - SOME DOS NOTES by Pete Carr Back in the old pre-Newdos, pre-double density, pre-Model III days there was no TRS-80 DOS compatibility problem. At that time Model I TRSDOS was the only TRS-80 DOS. All the DOS's that have followed made a point to follow TRSDOS's lead as far as diskette structure, directory organization, for the sake of compatibility. So when the first version of Super Utility was released it was easy for it to be compatible with ALL the DOS's because ALL DOS's were compatible! But those were easier, less complicated times. With the advent of the TRS-80 Model III and various Double Density boards for the Model I, there can hardly be any so called TRSDOS-COMPATIBLE, standard format; because TRSDOS itself is changing so much. Nowadays when someone says they are TRSDOS compatible you could ask, "Which TRSDOS are you talking about?" Most of the new DOS's work in a very similar fashion to the first Model I TRSDOS. But, because Tandy has been changing TRSDOS so much lately there has really been no reason, nor would it make any sense, to attempt to play follow the leader anymore. So this has actually freed other DOS authors to pursue different roads that allow them to implement more powerful features. This is good and bad. It is good, because it allows DOS authors to apply a very creative approach to writing a DOS. They don't have to worry about their product being EXACTLY compatible with TRSDOS anymore thus can write without being constricted by that thought in mind. The result of this is that we are able to have very powerful systems on a TRS-80 with features like double density that once were thought only feasible on a much bigger computer. Kind of a freeing of the programmers from forced conformity, if you will. Of course the bad part is the lack of compatibility between the DOS's. Thus it seems to be getting harder to write a program that will run on all DOS's. With this reality in mind the new Super Utility Plus has made it easy to work on any of the major DOS's, and the disk formatted by them, by its CONFIG feature. I will try to give an overview of the popular DOS's. There is no reason to go into minute details that you can read for yourself in the DOS's manual. I will not cover the basic features of the DOS's, but only some of the physical ways in which they differ. Some DOS's are not being supported on the market anymore or are so obscure that I won't cover much if anything about those that fit this category. We'll start with a quick overview of the Floppy Disk Controllers used in the TRS-80. 1. FLOPPY DISK CONTROLLERS (FDC) There are mainly three different FDC's, that for different purposes, are being used in the TRS-80 Model I and III at this time. An FDC is actually a ROM (read only memory) program that can be accessed by a programmer to perform certain functions pertaining to the floppy disk. These functions include writing "Data Address Marks", Head Stepping and various other needed functions of controlling your floppy disk. It depends on which machine (I or III) and if you have one of the available Double Density boards installed (Model I) as to which ones apply to you. Model I. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 2 The stock Model I comes with a 1771 FDC. This controller can read/write up to four different "Data Address Marks". These can be grouped as: 1. Standard 2. Read Protected 3. Deleted Data 4. User Defined Double Density Model I When you install one of the available Double Density boards you then have two FDC's in your Model I. Along with the 1771 FDC you now have a 1791 FDC which gives the Model I the capability of reading/writing all the DATA ADDRESS MARKS along with reading/writing double density. MODEL III The Model III comes with a 1793 FDC. This controller can read/write double and single density. It recognizes "Read Protected" and "Standard Data" BOTH as "Standard Data". Likewise, it also recognizes "Deleted Data" and "User Defined" as "Read Protected". Furthermore, it is only capable of writing the "Standard Data" and "Read Protect" marks which would be recognized in a Mod I as "Standard" and "Deleted Data". Due to the differences in data address mark recognition, some authors of the current DOS's are using the "User Defined" address mark on the directory track on Mod I single density diskettes so that it may be detected directly on the Mod III with no conversion. There are a couple of other FDC's sometimes used with the TRS-80 that are a little different (LX80 uses a Fuji) but the affects they have on compatibility for the most part are very small. 2. THE DISK OPERATING SYSTEMS. Super Utility+ DOS Config parameters 1. (A or a) - Single Density - Non-Ldos 2. (B or b) - Model III TRSDOS 3. (C or c) - Model I or III Single Density LDOS 4. (D or d) - Model I or III Double Density LDOS 5. (E or e) - Model I or III Single Density DOSPLUS 6. (F or f) - Model I Double Density DOSPLUS 7. (G or g) - Model III Double Density DOSPLUS 8. (H or h) - Model I Double Density DOUBLEDOS 9. (I or i) - Model I, III Double Density NEWDOS/80 V2 with Single Density Track 0 10 (J or j) - Model I, III Double Density NEWDOS/80 V2 with Double Density track 0 *NOTE: We will use TRSDOS 2.3 for the Model I as our model DOS. A difference is that most the other DOS's allow more than 35 tracks which could put the directory track in a different location than 17 (11H). They also give Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 3 you the option of Double Density, with the appropriate hardware, which has 18 sectors per track instead of 10. NEWDOS80 V2 and Percom's DOUBLEDOS do operate quite differently concerning the track sector format which will be discussed in the NEWDOS80 section. Model III TRSDOS 1.3 also operates differently which will be discussed in its section. TRSDOS 2.3 Model I TRSDOS uses a single density, 35 track, 10 sectors to the track, 256 bytes per sector, configuration. This DOS was written to be used with the FDC 1771. PHYSICAL STORAGE INFORMATION: THE DIRECTORY: Location - Trk 17 (11H) Sector 0 - Granule Allocation Table - GAT The first sector contains the Granule Allocation Table (GAT) information. This tells the operating system which granules are allocated to files or locked out and which ones are free to use. (One GRANULE = 5 sectors. 2 granules = 1 track). This sector also contains the disk master password, disk name, date and the AUTO command. The first 35 bytes contain information for each of the 35 tracks. In each of these 35 bytes is a HEX number representing allocation info about that track. Their meaning follows: FC = track empty FF = track full. FE = first 5 sectors available FD = last 5 sectors available The track lockout bytes start at byte 60H. If a track is locked out for some reason (unformatable), lets say track 8, then byte 68H will contain an FFH. If the track is available for system use it will contain an FCH. Depending on which DOS and TRS-80 Model you have, you could notice that its GAT uses a set of different HEX bytes than the ones mentioned above, but the idea will still carry through. Sector 1 - Hash Index Table - HIT The Hash Index Table contains a one byte code (hash code) for each file stored in the directory. The location of the hash code points to where a file is located in the directory sectors. They are grouped into eight sections, one for every file storage sector in the directory. Since the first two sectors of the directory contain the GAT and HIT tables, that leaves only eight sectors left (single density) for the actual file information. Sectors 2 to 9 - File Primary Directory Entries - FPDE File Extension Directory Entries - FXDE These sectors contain the actual directory information concerning the file names, attributes, passwords, size, end of file, etc. Each file (FPDE) is allowed 32 bytes for this information unless it needs more room for an Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 4 extension to that file. An extension is used when a file can't be stored in a physically contiguous manner on the diskette. If a file needs more than 4 extensions to be written to the diskette a File Extension Directory Entry (FXDE) is created. TRSDOS 2.3 will allow as many extensions to a file as there is free disk space. Model III TRSDOS works somewhat differently concerning these file extensions which will be discussed later. Most of the other DOS's allocate their directory information very similar to TRSDOS 2.3. except for the obvious track and density differences. DOSPLUS and LDOS single density conform to the first TRSDOS format, but of course, its double density and Model III versions do differ where applicable. They use the term cylinder instead of track because of their doublesided and hard disk capabilities. Instead of 10 sectors per track the Model III and double density versions of DOSPLUS and LDOS contain 18 sectors per cylinder (track), 6 sectors per granule, with 3 granules per cylinder (track). NEWDOS80 V2 Apparat's latest DOS has defined a new way of handling disk allocation. It uses a "disk relative sector" technique instead of using the real physical track sectors. This is the reason for the new term LUMP. The bytes in the GAT sector from 00 to BFH correspond to a LUMP instead of a track, so granules per lump is used instead of granules per track. NEWDOS80 V2 single density, uses 5 sectors per Granule, (more with double density) BUT can have 2 to 8 granules per LUMP. This allows the GRANS to span disk tracks, starting on one track and ending on another. According to Apparat, this maximizes the number of sectors per track while keeping a normal directory track format. NEWDOS80 V2 also allows a Single or Double density Boot track which is the reason for SU+ having the I and J Config params. DOUBLEDOS from Percom also uses this "Disk relative sector" technique like NEWDOS80. It does not have the capabilities of NEWDOS80 in defining how many granules to use per LUMP or defining which density the BOOT shall be; but its physical way of handling the disk is similar. Thus, it needs only one SU+ Config param which is (H). TRSDOS 1.3 - Model III This DOS uses a different way of defining its directory and physical sector format. It contains 18 sectors per track starting at sector 1 instead of the usual starting point of 0. Its Granules are 3 sectors long for a total of 6 Granules per track. Its directory uses a 48 byte FPDE instead of the usual 32 bytes. These extra bytes allow it to have more extensions without creating an FXDE (file extended directory entry). Matter of fact Model III TRSDOS 1.3 does not use the FXDE procedure for allocating file extensions at all! As stated before all other DOS's will continue to create FXDE's until your disk is full. TRSDOS 1.3 will not do this, BUT you are allowed up to 13 extensions which should take care of all but the most unusual cases. A pretty good tradeoff for a cleaner and hopefully easier to manipulate directory, giving the DOS less chance for error! The other major difference is as mentioned above TRSDOS 1.3 uses a sector offset of 1. This means that each track's sector starts at 1 instead of 0 like the other DOS's. Use the Super Utility + config param (B) for TRSDOS 1.3 Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 5 This manual will attempt to provide the assembly language programmer with information needed to interface programs with Super-Utility Plus. This is not a tutorial on machine language programming, and a basic understanding of the TRS80 microcomputer and assembly language programming is assumed. Super-Utility Plus has the capability to access most devices currently available on the Model I and III. With this manual, routines not available in SU+ may be implemented by the user. This manual contains examples in the back of routines that may be added to the SU+ program. This manual does not contain source code for SU+, nor are specific details revealed about the intimate workings of the program. What will be covered in this manual is an explaination of the system labels and entry points available in SU+. A listing of these labels and their specific address is available through the SU+ program, and is explained in the manual provided. When the label points to an entry point of a complex function of SU+, only the function of the routine is described. Thus, the entire sequence for "Display Disk Sectors" is not given, but just that it is the entry point for that complex routine. All subroutines throughout the program are defined and documented however. When one subroutine calls another, that link will usually be shown. Throughout this manual, the following notations will apply: First, the name of the label is shown, preceded by an @ symbol. Then a brief description of the function of the routine is given. Then, if applicable, the Entry and Exit conditions are given. If this is an entry point to a complex routine, only the routine itself is mentioned. Only CPU registers that are involved in the routine itself are mentioned. Both the entry and exit conditions are listed. If a register(s) is NOT mentioned in a routine, it is implied that it is NOT USED, or that it is NOT CHANGED. Most of the routines will preserve as many registers as possible so that parameters contained elsewhere are not disturbed. If a register or label is shown surrounded by parentheses, then THE CONTENTS of that register/label is implied. Thus, (HL) means the contents of the address pointed to by HL. If HL=4000H, and the byte at 4000H=0AH, then (HL)=0AH. If the symbol => appears after a register pair or label, then the registers/label POINTS TO an address in memory. Thus if HL=>@BUFFER, then HL points to a buffer to be used. If the symbol = appears after a register or label, then that register/label EQUALS the parameter. Thus, if A=drive, then the Accumulator must contain the drive number to be used. A sample printout of the addresses of the labels in the current version of SU+ (2.2) are given on the following page. If you have an older version, or none at all, please read ahead to 'order / upgrade information' Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 6 SUPER-UTILITY PLUS ORDER / UPGRADE INFORMATION. Super-Utility is currently being shipped as follows: Mod I = $ 74.95 Mod III = $ 74.95 Mod I/III = $124.95 If you currently own either the Mod I or III versions of SU+, you can upgrade to a I/III booting diskette. We are offering $25.00 off on the second version. Send in your original diskette with $50.00 to upgrade to both versions. Once you have the program(s), you can update your diskette(s) to the current version at any time for $3.00 per diskette. This $3.00 cost applies to a single diskette, regardless of which version(s) you may have on the disk. All purchases/upgrades should be addressed to: Breeze/QSD, Inc. 11500 Stemmons Fwy. Suite 125 Dallas, Texas 75229 (214) 484-9428 Copyright (c) 1982 Breeze/QSD, Inc. [Pages 7-9 were not included in the word processor source files for the manual. They were probably assembler files giving the numeric addresses for the entry points documented in the manual.] Super Utility Tech Manual Page 10 @MODE --------- Current modify mode number base: (1 byte) 0 = HEX 1 = Decimal 2 = Binary 3 = Octal 4 = Ascii @SECTOR --------- Current setting of LAST for sector number. (1 byte) @TRAK --------- Current setting of LAST for track number. (1 byte) @CURSOR --------- Current video cursor address. (2 bytes) @EOFB --------- End of file byte for current file. (1 byte) @EOFS --------- End of file sector for current file. (2 bytes) @EOAS --------- End of allocation sector for current file. (2 bytes) @FREEG --------- Free granules on current disk. (2 bytes) @FREEF --------- Free files on current disk. (1 byte) @CGRANS --------- Holds number of grans to copy in copy files. (2 bytes) @ADDRESS --------- Current address to be displayed. (2 bytes) Used by @SHOW. @DEFADDR --------- Address to be used in jump to memory. (2 bytes) Defaults to @MENU. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 11 @FMTBUFF --------- Address used by @BUILD when formatting a track. @MIDBUFF --------- Address of the middle of the buffer area. Used by exchange disk sectors. @DIRCOUNT --------- Holds the sector count of the last directory read into memory. @DIRPAGE --------- Holds the position in the directory of the current portion being displayed by kill/restore files. Only 8 sectors of data can be displayed at a time, and the byte here indicates the current 8 sector location. @TRUE --------- The REAL track as it is read from the disk. Used by display disk sectors. @TYPE --------- Indicates where the displayed data came from. 1 = from display disk sectors 2 = from memory 3 = from display file sectors @TOPMEM --------- Holds the address of the current top of memory +1 Normally contains 0000H. @NUMTYPE --------- Holds the base of the last string where @VALUE was extracted. @RESULT --------- Holds the non-masked result of the last disk I/O. @TEMP0 --------- Temporary storage area. (2 bytes) @TEMP1 --------- Temporary storage area. (2 bytes) @TEMP2 --------- Temporary storage area. (2 bytes) Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 12 @TEMP3 --------- Temporary storage area. (2 bytes) @TEMP4 --------- Temporary storage area. (2 bytes) @TEMP5 --------- Temporary storage area. (2 bytes) @TEMP8 --------- Temporary storage area. (2 bytes) @NMIVECTR --------- Non-maskable return address for disk I/O. Used by Mod III version only, unused in the Mod I. @RETNMI --------- RETN instruction, normally, @NMIVECTR points here if there is no current disk I/O in progress. Not executed on the Mod I. @TEMP9 --------- Temporary storage area. (2 bytes) @FLAGA --------- System parameters flag. Bit 7 = set = DUAL currently ACTIVE Bit 6 = set = Highspeed clock is ON Bit 5 = set = Dual Flag ON Bit 4 = set = Save Config ON Bit 3 = set = Extended ID marks ON Bit 2 = set = Replace string in string search Bit 1 = set = Alive OFF Bit 0 = set = Keyboard case reversal ON @FLAGB --------- System parameter flag for printer. (1 byte) Bit 7 = set = Graphics ENABLED Bit 6 = set = Lower Case ENABLED Bit 5 = set = MX80 graphics adjust ENABLED Bit 4 = set = TRS232 Serial output Bit 3 = set = Linefeeds ENABLED Bit 2 = unused Bit 1 = unused Bit 0 = unused Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 13 @DTTBL --------- Table of bytes to be used for @TYPEA when a DOS specifier is used. (10 bytes representing A-J) @LASTB --------- LAST byte specified when using the GO command in modify mode. @DRVSAVE --------- Current drive settings. (20 bytes) Contains @TRACKS, @DIRTRK, @TYPEA, @TYPEB, @TRACK @TRACKS --------- Current track counts. (4 bytes) Represents drives 0-3. @DIRTRK --------- Current directory track. (4 bytes) @TYPEA --------- Current drive DOS specification. (4 bytes) Bit 7 = set = Double Density. Bit 6 = set = Double Sided disk. Bit 5 = set = Directory forced at track 17. (Indicates DoubleDOS) Bit 4 = set = Disk relative sectors. (Indicates ND80 DD or DoubleDOS) Bit 3 = set = Track 0 Double Density Bit 2 = set = Mod III TRSDOS flag. Bit 1 = set = DOS+ flag. Bit 0 = set = LDOS flag. @TYPEB --------- Current drive parameters. (4 bytes) Bit 7 = set = Software Drive Not in System ENABLED. Bit 6 = set = Software Write Protect ENABLED. Bit 5 = set = Drive motor on delay = 1/2 second. Bit 4 = set = Double Step this drive. Bit 3 = set = Drive ENABLED in multi drive routines. Bit 2 = set = 2nd side ENABLED in Double Sided Drive. Bit 1 and 0 = Step speed for drive. 0 = 6 ms. 1 = 12 ms. 2 = 20 ms. 3 = 40 ms. @TRACK --------- Table indicating current drive head location. (4 bytes) @SAVEDRV --------- Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 14 Duplicate table for first 16 bytes of @DRVSAVE. Used to restore tables to previous setting when SAVE CONFIG is ACTIVE. @SDRIVE --------- Binary drive number of current SOURCE drive. @DDRIVE --------- Binary drive number of current DESTINATION drive. @KEYBRD --------- Mask area used by keyboard driver. (7 bytes) @MFLAG --------- Flag indicating if DISK MOUNT prompts are to be issued. @DISP1 --------- Current DECRYPT mode. (1 byte) Will contain one of the following symbols: + = addition - = subtraction A = AND O = OR X = XOR S = SHIFT R = ROTATE @DISP2 --------- Modifier byte of @DISP1. (1 byte) If +, -, A, O, or X, then this byte contains the value to be added, subtracted, etc. If S or R, then this byte contains L or R to indicte if shifts/rotates are Left or Right. @DISP3 --------- Modifier byte of @DISP2. (1 byte) If @DISP1 contains S or R, then @DISP2 contains the direction, and this byte contains the number of Rotations/Shifts. @COUNT --------- Temporary countdown storage. (2 bytes) @INPUT --------- I/O buffer and work space when reading ID marks. (10 bytes) @STRING --------- Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 15 Input buffer for keyboard. (70 bytes) @STACK --------- Stack area. (backward for 144 bytes) @FILEDCB1 --------- Device control block #1 for filenames. (16 bytes) @FILEDCB2 --------- Device control block #2 for filenames. (16 bytes) @PASSWRD1 --------- Ascii password storage area #1. (8 bytes) @PASSWRD2 --------- Ascii password storage area #2. (8 bytes) @DISPLY (RST 08H) --------- Video display driver. Entry: Data must immediately follow the CALL. Data terminates with 00H. Exit: Control passed to byte following terminator. ALL registers AND Flags are preserved. @CONTRL --------- Video display driver for control bytes. (less than 20H) Entry: A = byte to display HL = cursor position 7 = clear screen 8 = backspace 9 = center cursor on screen if left half, else linefeed 10 = linefeed 11 = upward linefeed 13 = linefeed 29 = move cursor to beginning of line 30 = beginning of line AND erase line Exit: HL = cursor position NOTE: (@CURSOR) is NOT updated. @CLS --------- Clear video screen to spaces. Entry: NONE Exit: HL = 3C00H NOTE: (@CURSOR) is NOT updated. HINT: It is best to display control codes via use of @DISPLY. To clear the screen, for example: RST 8 ;call @DISPLY Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 16 DEFB 7 ;clear screen code DEFB 0 ;terminator This routine only requires 3 bytes, ALL registers are preserved, and (@CURSOR) IS updated. @GETSTR (RST 10H) --------- Get a string of characters from keyboard. Entry: B = maximum length of input Exit: B = length of input C = maximum length of input HL => input string (=@STRING) A = first character input Z = NO characters input (represents status of B register) @CURON1 --------- Cursor ON character. @CURON2 --------- Cursor ON character. (@CURON1 and @CURON2 MUST be the same). @CUROFF --------- Cursor OFF character. @CURCNT --------- Countdown byte for cursor flash speed. @KEY --------- Scan keyboard. Entry: NONE Exit: A = input character Z = NO character input (A = 0) NOTE: This call will perform the following functions: Repeating keys Upper/Lower case toggle with SHIFT 0 Screen printer with SHIFT CLEAR There is NO keybounce delay with this call (very fast) @KEYDLY1 --------- Delay before key begins repeating the FIRST TIME. @KEYDLY2 --------- Delay between key repeats AFTER the first time. @KIGO --------- Scans keyboard for key, but keys WILL NOT repeat. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 17 Entry: NONE Exit: A = input key BC, DE, HL are destroyed NOTE: Calls should be preferably made to @KEY as all registers except A are preserved. @SCREENPRT --------- Sends contents of video to the printer. Entry: NONE Exit: A = 0 Z flag set BC, DE, HL destroyed NOTE: Screenprinting is handled via @KEY, and registers are preserved. @POUTXX --------- Sends a byte to lineprinter from printer buffer. This call is normally made from @IFPRINTR from interrupt service (printer spooling). Entry: A = character to print Exit: A, BC are destroyed NOTE: Normally, to send a byte to the printer, call @POUT which inserts the character into the printer buffer to be printed by the spooler under interrupt service. @SERIALOT --------- Send a byte to the printer via RS232 connection at port FFH. Entry: B = character to print Exit: BC, HL are destroyed NOTE: This call is made by @POUTXX if bit 4 of @FLAGB is set. @GET --------- Unstacker routine. Pops BC, DE, HL, and set flags for A. Return vector used by @KEY. @KEYTABLE --------- Lookup table for last row of keyboard. (16 bytes) Keys represented by this table in order: ENTER SHIFT ENTER CLEAR SHIFT CLEAR BREAK SHIFT BREAK UP ARROW SHIFT UP ARROW Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 18 DOWN ARROW SHIFT DOWN ARROW LEFT ARROW SHIFT LEFT ARROW RIGHT ARROW SHIFT RIGHT ARROW SPACEBAR SHIFT SPACEBAR @CKDUL --------- If DUAL is ACTIVE, character sent to printer buffer via @POUT. NOTE: This call is made by @DISPLY to check for DUAL operation. @DLON --------- A call here copies bit 5 from @FLAGA to bit 7. If DUAL is ON, but INACTIVE, it will be made ACTIVE. @DLOFF --------- Will DEACTIVATE DUAL, but not turn it off. NOTE: @DLOFF is used when the message: Reading/Writing/Verifying Track x, Sector x is being displayed to prevent the repeated messages from being sent to the printer. Thus if dual is ON, and a directory is being read, for example, the directory listing will be sent to the printer, but not the READING messages. @DLON will reinstate DUAL if it was ON prior to @DLOFF. @IFPRINTR --------- This is the printer spooler driver. It is called under interrupt service. If (@PRCOUNT) is zero, then there are no characters in the buffer, and nothing is done. If there ARE characters in the buffer, the CLEAR key is checked. If pressed, and NOT the SHIFT key, then (@PRCOUNT) is set to 0 (buffer is emptied). If CLEAR is NOT pressed, the character is sent to the printer via @POUTXX. @PRCOUNT --------- This is the current position (count) of characters in the printer buffer, maximum of 400H. (2 bytes) @POUT --------- Send a byte to the printer buffer to be spooled. Entry: A = character to be printed Exit: ALL registers AND Flag are preserved NOTE: This does not PRINT the byte, but merely inserts it Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 19 into the printer buffer to be printed later under interrupt service. If the buffer is FULL (400H bytes), then this routine will wait till space is available. @XREAD --------- Reverses status of IBM read, then jumps to @READNS. Entry/Exit: Same as @READNS @READNS --------- Read a disk sector into a memory buffer. No SEEK operation is performed, so the drive head MUST be positioned over the correct track. This routine will read a NON-STANDARD sector. Entry: D = Track E = Sector BC => Buffer (@DRIVE) = bit pattern for drive to be read Exit: BC => Buffer+100h (set for next READ) HL is destroyed Z = OK NZ = Bad, error status in A @WRITENS --------- Write a disk sector from memory buffer. Same as @READNS, but will WRITE a disk sector. @TREAD --------- Reverses the density of the drive, then jumps to @READ @READ --------- Normal call to read a standard disk sector. Head is positioned to the correct track before the read operation is performed. Entry/Exit same as @READNS. @TWRITE --------- Same as @TREAD, except sector is WRITTEN to the disk. @WRITE --------- Normal call to write a standard disk sector. Seek operation is performed to position to correct track. Entry/Exit same as @READNS. NOTE: In all the above Disk I/O routines, the register contents for Entry/Exit are the same. Normally, calls to @READ and @WRITE will be used for standard diskettes. Automatic density recognition can be achieved as follows: CALL @READ ;attempt to read the sector CALL NZ,@TREAD ;if bad, try other density Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 20 CALL NZ,@BADRD ;bad in both densities JP NZ,4018H ;abort function @FLIPDEN --------- Reverses the density of drive. Entry: (@DRIV) = Binary drive number Exit: A is destroyed @READ1 --------- Vector for @READ, perform SEEK operation. @READ1S --------- Vector for @READNS, SEEK operation bypassed. @RDTYPE --------- Byte to be used for READ operation. Mod I: 88H = IBM format read 80H = Non-IBM format read Mod III: 80H = IBM format read 88H = Non-IBM format read @WRITE1 --------- Vector for @WRITE. A SEEK is performed. @WRITE1S --------- Vector for @WRITENS. SEEK operation bypassed. @WRTYPE --------- Byte to be used for sector write operation. Mod I / Single - Double Density: A8H = STANDARD address marks A9H = READ PROTECTED address marks Mod I / Single Density: AAH = DELETED DATA address marks ABH = USER DEFINED address marks Mod III: A0H = STANDARD address marks A1H = READ PROTECTED address marks @SEEK --------- Move drive head to specified track. Entry: D = Track to move head to Exit: Z = OK NZ = Bad, error code in A @SELECT Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 21 --------- Select a drive and turn motor on. Entry: (@DRIVE) = bit pattern for drive Exit: Z = OK NZ = Bad, error code in A @DRIVE --------- Bit pattern for drive to operate on Bit 3 = Drive 3 Bit 2 = Drive 2 Bit 1 = Drive 1 Bit 0 = Drive 0 NOTE: All routines involving (@DRIVE) may be set via @SETDRV @DSKSLO --------- Delay loop to wait before valid status can be read from FDC. @DELAY --------- Decrement BC till 0. If Highspeed clock is ACTIVE, the delay count will be doubled. Entry: BC = Delay count (0 - FFFFH) Exit: BC = 0, ALL other registers AND Flag are preserved. @GETTRK --------- Get/Put current head location of a drive. Entry: NC = Get byte from table C = Put byte in table, byte in A (@DRIV) = binary drive number Exit: A = current byte in table Z = current track is 0 C flag is RESET @GETDIR --------- Get/Put current directory track of a drive. Entry: C = Put byte in table, byte in A NC = Get byte from table (@DRIV) = binary drive number Exit: If C on entry, then A = current byte in table, C flag RESET If NC on entry, then DE = starting track/sector of the directory, and A = the number of sectors on the track @GETDIR0 --------- Vector for @GETDIR when C flag is set. @GETTYPEA --------- Get/Put byte from TYPEA table for specified drive. Entry: C = put byte in table, byte in A NC = get byte from table Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 22 (@DRIV) = binary drive number Exit: A = current byte from table C flag is RESET @GETTYPEB --------- Get/Put byte from TYPEB table for specified drive. Entry/Exit: Same as @GETTYPEA @GETTKS --------- Get/Put track count for specified drive. Entry/Exit: Same as @GETTYPEA @GETCOMM --------- Common vector for above routines to get/put byte in table corresponding to contents of @DRIV. @DRIV --------- Binary drive number for current drive (0-3). @RESTORE --------- Move head on a drive to track 0. Entry: (@DRIVE) = bit pattern for drive to be used Exit: HL = destroyed Z = OK NZ = Bad, error code in A @MOVCOMM --------- Common routine for all drive head motion commands. Entry: (@DRIVE) = bit pattern for drive to be used. A = command to be issued Exit: HL = destroyed Z = OK NZ = Bad, error code in A @MOVEHEAD --------- Issue head motion command to FDC, and wait till done. Entry: (@DRIVE) = bit pattern for drive. A = command to be issued HL = 37ECH (if Mod I) Exit: Z = OK NZ = Bad, error code in A NOTE: All of the above head motion commands are handled normally via calls to @READ and @WRITE. @STEPIN --------- Move head on a drive IN one track (away from track 0). Entry: (@DRIVE) = bit pattern for drive Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 23 Exit: HL is destroyed Z = OK NZ = Bad, error code in A @STEPOUT --------- Move head on a drive OUT one track (toward track 0). Entry/Exit: same as @STEPIN @DOSEEK --------- Move head to track specified by D register. Vector from @SEEK if head NOT already on specified track. @SETDRV --------- Set @DRIVE and @DRIV for future table/disk operations. Entry: A = Binary drive number (0-3) Exit: A = Binary drive number IN ASCII (@DRIVE) = bit pattern for selected drive (@DRIV) = binary drive number supplied at Entry @DRVASC --------- Get current drive number IN ASCII. Entry: (@DRIV) = binary drive number Exit: A = drive number in Ascii @TASK --------- Interrupt service (background task). Following operations are performed every 25 ms in the Mod I and every 33 ms in the Mod III. 1. Check if BREAK key is pressed 2. If NO, then goto step 6. 3. If YES, and NO SHIFT KEY, do step 5, then JP 4018H 4. If YES, and SHIFT KEY, do step 5, then JP 4015H NOTE: 4015H jumps to master menu 4018H returns to sub-menu 5. Print , wait till key is released, and return 6. If master menu is displayed, change + to ! 7. If ALIVE is ACTIVE, change # to * in upper right corner on video 8. If any bytes in printer buffer, send 1 byte to the printer @SETNMI (Mod III only) --------- Setup routine for disk I/O for non-maskable interrupts. @MENU00 --------- In the event that the return vector to a sub-menu (4018H) is invalid, a jump here will be forced to initialize the @WHERE vector and normalize the pointers. Control will then be passed to @MENU. @MENU Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 24 --------- Entry point to MASTER MENU. @MENUGO --------- Lookup table to get jump vector for selection from the master menu. Each entry in the table (and all menu tables), is 3 bytes long, and the table is terminated with 0. First byte is the table is the ascii character to match. If a match is found, the next 2 bytes indicate the address where control is to be passed. Example: DEFB '1' ;if "1" is selected from keyboard DEFW @ZAP ;then jump to address @ZAP @GETSEL --------- After printing a menu/sub-menu, DE points to a table of allowable responses and jump vectors. DE => table of input/vectors as above Prints 2 linefeeds, then asks "Selection ? " Call @GETSTR, allow 1 character maximum. If "L" is entered, get LAST from table and return If ENTER is pressed alone, jump to first address in table. Otherwise, put byte in LAST, and compare to table. If match is found, jump to appropriate routine, else ask again. @LCMD --------- LAST command issued from a menu. @GOTABLE --------- Locate byte in A in table, and jump to appropriate vector. Entry: DE=> table of 3 byte entries, 0 terminator (first byte is number to match, followed by a 2 byte address in the case of a match) A = number to locate in table Exit: If match is found, return address is popped off the stack and a jump is made to the corresponding vector If no match is found, control will return to caller. EXAMPLE of use of @GOTABLE RST 8 ;call display driver DEFB 10 ;linefeed DEFM 'Choice ? ' ;prompt DEFB 0 ;message terminator LD B,1 ;allow one key input RST 10H ;get keyboard input JR Z,EXAMPLE ;nothing, try again LD DE,TABLE ;point to table of responses/vectors CALL @GOTABLE ;check if a match JR EXAMPLE ;will not return if a match is found @ZAP --------- Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 25 Entry point to ZAP sub-menu @ZAPWHR --------- Table of jump vectors for reply to Zap menu (used by @GOTABLE). @SETUPS --------- Each sub menu calls here to update (@WHERE) for return vector. The stack is initialize to the starting area. Entry: A = sub menu number 0 = master menu 1 = @ZAP 2 = @PURGE 3 = @FORMAT 4 = @COPY 5 = @REPAIR 6 = @TAPE 7 = @MEMORY 8 = @FILES 9 = @CONFIG @INKEY --------- Call @KEY, and add debounce delay. NOTE: This is the normal call to strobe the keyboard. @GOBACK --------- Display "Press to continue. " message, wait for the enter key, then return to sub-menu via @RETURN @RETURN --------- Takes byte from @WHERE (sub-menu number), loads DE with @RETADD and calls @GOTABLE. If a match is found, then a jump is made to the appropriate sub-menu. If no match, and jump to @MENU00 to re-normalize the @WHERE vector. NOTE: This is the normal exit from ALL routines in SU+ @WHERE --------- Number of the current sub-menu. See @SETUPS for details on values found here. @RETADD --------- Lookup table of vectors to sub-menus. Used by @RETURN. @PRESS --------- Display "Press to continue " message, wait for enter key, then return to caller. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 26 @DISDSK --------- Entry point to Display Disk Sectors routine. @DISTBL --------- Lookup table for responses to "paging mode" in Display Disk Sectors. @NEXSEC --------- Advances DE to next sector on the disk. Entry: D = Track E = Sector Exit: DE = next track sector A is destroyed C = disk limits have been exceeded (D >= (@TRACKS) ) NC = OK @DOWNSEC --------- Advances DE BACKWARDS to next sector on the disk. Entry: DE = Track/Sector Exit: DE = next sector BACKWARDS A is destroyed If DE is on the FIRST sector on the disk, nothing done @TRKEND --------- Returns the highest sector number on current track. Entry: D = current track Exit: A = highest sector number on current track @ADDR20 --------- Sector numbers are read from the disk 20 time via @ADDR. Numbers are stored sequentially starting at @DAMBUFF. Used to locate the highest/lowest sector on a track. Entry: (@DRIVE) = bit pattern for selected drive Exit: A, B, HL, IX are destroyed 20 sector numbers from current track stored at @DAMBUFF @GETDAT --------- Get "Drive, Track, Sector ? " from keyboard. Entry: NONE Exit: (@DRIVE) and (@DRIV) valid for selected drive. DE = Track/Sector NOTE: If drive is not specified, then 0 is used. If track/sector not specified, then the first sector on the disk is used. @ASCII (RST 18H) --------- Convert binary number to ascii Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 27 Entry: A = binary number to convert Exit: ACB = ascii number EXAMPLE: LD A,127 ;start with binary number RST 18H ;convert to ascii LD (NUM),A ;store MSB in string LD (NUM+1),BC ;store rest in string RST 8 ;display the number NUM EQU $ DEFM 'xxx' ;where it goes DEFB 0 ;message terminator @POSHL --------- Parse through string, skip spaces and commas. Position HL to first valid character. Entry: HL => string Exit: A = first non-blank, non-comma character HL => first character C set if first character is terminator (0DH) @MOVE --------- Move block of data. Blocks may overlap. Entry: HL => Source address of data DE => Destination address of data BC = Length of data to be moved Exit: A is unused only @VALUE --------- Extract value from input string. Entry: HL => string Exit: (IX) = base of input number BC = value of input HL => terminator (space, comma, C/R) C = invalid number Z = value is one byte (0 to 0FFH) NZ = value is two bytes (100H to FFFFH, status of B rewgister) A = LSB of number (copy of C register) DE is unused @DEFBASE --------- Default base to be used by @VALUE if no base specifier is appended to the number. This value can be hard configured. @MULTIPLY --------- Multiplies BC times (IX). Entry: BC = value (IX) = base of number as set from @VALUE Exit: BC = new value Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 28 @PURGE --------- Entry point to Purge Utility @PURWHR --------- Lookup table for responses to Purge Utility Selection. @FORMAT --------- Entry point to Format Utility. @FMTWHR --------- Lookup table for Format Utility Selection. @COPY --------- Entry point to Disk Copy Utility @CPYWHR --------- Lookup table for Disk Copy Selection. @REPAIR --------- Entry point to Disk Repair Utility @REPWHR --------- Lookup table for Disk Repair Selection. @MEMORY --------- Entry point to Memory Utility @MEMWHR --------- Memory Utility lookup table for selection. @TAPE --------- Entry point to Tape Utility. @TAPWHR --------- Lookup table for Tape Utility Selection. @FILES --------- Entry point to File Utility. @FILWHR --------- Lookup table for File Utility Selection. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 29 @EXIT -------- Entry point to EXIT program routine. @DEAD -------- Executes a RST 0 on the Mod III, or a HALT on the Mod I. @MOUNTSYS --------- Asks for SYSTEM disk to be mounted, and waits for ENTER key To be pressed. Video line is then cleared. Entry: (@DRIV) = binary drive number to be mounted Exit: A is destroyed @ONEKEY --------- Waits for ENTER key to be pressed, then clears the Current line the cursor is on. Entry: NONE Exit: A is destroyed @MOUNTSRC --------- Asks for SOURCE disk to be mounted, and waits for ENTER. Entry: (@DRIV) = binary drive number for disk to be mounted on. Exit: A is destroyed @MOUNTDES --------- Asks for DESTINATION to be mounted, and waits for ENTER. Entry: (@DRIV) = binary drive number to be mounted. Exit: A is destroyed. @DRVCOMM --------- Executes a common routine for all active drives. Active drives are indicated by bit 3 being set in table @TYPEB. Entry: Bit 3 set in @TABLEB indicates active drive. DE = Address of common call for all drives. BC = Address of exit to make when all drives completed. Exit: Made to address supplied by BC. BC, DE A are destroyed NOTE: The ENABLE bit in @TYPEB is set properly by making a Call to @GETDRVS. HL, IX, and IY are not used, and may be passed along. @DRIVE and @DRIV are updated to each current drive before The call is made to each subroutine. @POSA --------- Current drive counter used by @DRVCOMM. User subroutines May alter the contents of @DRIVE and @DRIV if needed, and They will be corrected by @POSA when the current drive Is completed. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 30 NOTE: (@POSA) and (@DRIV) are equal when entry is made to The subroutine for each drive. @INITDRVO --------- Sets all drives in @TABLEB as ACTIVE. (Sets bit 3) ALL registers are preserved. @INITDRV --------- Sets all drives in @TABLEB as INACTIVE. (Resets bit 3) ALL registers are preserved. @SHOCONFG --------- Inserts SOFT CONFIGURE setting onto video display. Registers AF, BC, DE, HL, IY are used. NOTE: This displays the SETTINGS ONLY, not the headings. @SETYES --------- Loads "Y" or "N" into A depending on Z flag. Entry: Z flag set/reset as applies. Exit: If NZ, then A = "Y" If Z, then A = "N" NOTE: This is useful for inserting ascii Y or N into a string Depending on the setting of a flag bit. EXAMPLE: BIT 3,(IY) ;check for status bit CALL @SETYES ;load A with Y or N LD (MSG),A ;put into string @DSTAT --------- Checks status of disk drive (disk mounted and door closed). Entry: (@DRIV) and (@DRIVE) indicate the drive to be checked. If drive NOT READY, message to correct the problem Are displayed. Exit: Z = OK NZ = "Skip this drive" was selected @STAT --------- Checks status of disk drive. Entry: (@DRIVE) and (@DRIV) indicates drive number. If drive NOT READY, no message is displayed. Exit: Z = OK, drive mounted and door closed. NZ = Drive NOT READY, HL => error condition message. @SELDEN (Mod I only) --------- Selects the proper FDC controller in the Mod I. Entry: (@DRIVE) and (@DRIV) = drive number to use. Exit: If single density selected (Bit 7 @TYPEA is RESET) Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 31 Then the 1771 controller is selected. If double density selected (Bit 7 @TYPEA is SET) Then the 1791 controller is selected. A and A' are used. NOTE: This routine only applies if a hardware double density Modification has been installed. NOTE: The Mod I has TWO floppy disk controllers (FDC) for Double density operation. The Mod III has ONE controller That performs both single and double density. Hence This routine is not needed in that machine. @ZBUFF --------- Zero's a memory buffer. Entry: BC => Address to be cleared. Exit: 256 bytes of zeroes written to the buffer. ALL registers are preserved. @RXFER --------- Handshaking routine used for disk I/O. Entry: Mod I HL = 37ECH DE = 37EFH BC => Memory buffer Mod III HL => Memory buffer D = (@DRIVE) E = 2 B = 0 (byte counter) C = F3H (port address) Exit: Data transferred to address supplied. (@RESULT) = non-masked result of operation. (@TEMPFF) = address +1 of last byte transferred. NOTE: Read command must be issued BEFORE calling this. This is normally called via @READ @WXFER --------- Transfer data from FDC to memory buffer. Entry/Exit: same as @RXFER, except data is transferred TO disk. @ADDR --------- Reads 1 address mark from disk on current track. Entry: (@DRIVE) is valid for drive to be used. Exit: HL=> 6 byte string of values read in: Track, Head, Sector, Length, and 2 CRC bytes All other registers preserved except A. Z = OK NZ = Bad, error code in A. NOTE: this is called by @DISDSK to determine the REAL Track on a disk, versus the RELATIVE track. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 32 LD A,1 ;use drive 1 CALL @SETDRV ;set it up for use CALL @ADDR ;read address mark from disk LD A,(HL) ;get REAL track as read from disk OR A ;clear carry flag LD L,A ;L = REAL track CALL @GETTRK ;A = RELATIVE track (from table) @UCASE --------- Convert byte in A to upper case. Entry: A = byte to be converted. Exit: A = upper case equivalent. NOTE: Only bytes from 60H to 7FH are converted. @FIGDRV --------- Used to interpret a drive number from an input string. Entry: HL => input string Exit: If no drive is specified, then drive 0 is defaulted. If DOS specifier is appended, then table @TYPEA is set. If =tks is specified, then table @TRACKS is set. NC = OK C = invalid input for drive number. @DENSELSET --------- Inserts DOS specifier into @TABLEA. Entry: B = DOS specifier setting. Exit: @TABLEA is updated. NOTE: This is normally called through @FIGDRV. Calling @CKCONF sets B with the correct value. @DDOSFIX --------- DE (track/sector) is adjusted to DISK RELATIVE sector If ND80 DD or DoubleDOS sector is being read. Entry: DE = Track/Sector to be read Exit: Original value left on stack, and DE is returned with The correct RELATIVE value. LD DE,0 ;track 0/ sector 0 CALL @DDOSFIX ;compute RELATIVE sector POP HL ;DE = RELATIVE sector, HL = REAL sector NOTE: This routine is called by @READ and @WRITE to adjust To the correct value for the corresponding DOS. LD A,'I' ;set ND80 DD, single track 0 CALL @CKCONF ;B now equals the correct @TYPEA byte CALL @DENSELSET ;insert into table LD DE,1100H ;track 17, sector 0 CALL @DDOSFIX ;DE now equals 0A08H (relative sector) Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 33 @TASKDRV --------- If a disk sector is NOT FOUND on a bad read, this routine Will insert a 0 into the current track for that drive. This forces an @RESTORE call to be made the next time that Drive is read to position to the correct track. Entry: (@TASKDRV) = C9H (RET) if NO error (@TASKDRV) = 00H (NOP) if error HAS occured. Exit: If error HAS occured, then the current track for the Drive specified by (@DRIV) is updated to 0 If NO error, then nothing is done. NOTE: This vector is handled normally by the system, and is Called by @RETURN at the completion of each routine. @TURNSPEED --------- Turns high speed clock ON or OFF appropriately. Entry: Bit 6 of @FLAGA = set = turn speed ON Bit 6 of @FLAGA = reset = turn speed OFF Exit: If Bit 6 = 0, then @SPEEDOFF is executed. If Bit 6 = 1, then @SPEEDON is executed. @SPEEDOFF --------- Six bytes of instructions to turn high speed clock OFF. @SPEEDON --------- Six bytes of instruction to turn high speed clock ON. NOTE: The instructions may be modified via either HARD or SOFT CONFIGURE commands. Normally only A is used, but may be User definable to use other registers. @CONFIG --------- Entry point to SOFT CONFIGURE routine. @FIXFLG --------- Sets a bit of a flag byte. Entry: DE => flag byte to be used. C = mask byte of bits to be RESET. B = mask of bits to be SET. Exit: (DE) are updated Exit is made via @POSHL to move HL to next byte in string. LD DE,@FLAGA ;point to flag A CALL @YESNO ;set Z or NZ if A = "Y" or "N" LD BC,807FH ;bit 7 mask bytes JR Z,CONT ;skip if answer is Y LD B,0 ;else set bit 7 to be RESET CONT EQU $ ;label CONT CALL @FIXFLG ;bit 7 (DE) is SET or RESET if "Y" or "N" Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 34 @ASKFIG --------- HL = video location to get keyboard input. (Normally called through @CONFIG) Entry: HL = video location for prompt Exit: Left 2 characters on EACH video line is erased. => prompt displayed at location (HL) Exit condition for @GETSTR applies, 60 chars maximum. @YESNO --------- Checks if A contains "Y" or "N" Entry: A = character to check Exit: Z = A contained "Y" or "y" NZ = A contained "N" or "n" C = neither of the above was found @SHOW --------- Displays block of data in memory to the screen Entry: (@ADDRESS) = starting address to display Exit: 256 bytes of data are displayed to the screen If decrypting is specified, it will be displayed. Screen will contain HEX and ASCII representations of data. NOTE: This routine is normally called through display disk Sectors, file sectors, memory, or build track. Any address may be displayed. @HEXCV (RST 20H) --------- Convert binary number in A to HEX ASCII. Entry: A = binary number to convert Exit: BC = HEX ASCII representation (LSB, MSB) LD A,16 ;number to be converted RST 20H ;convert to ASCII LD (MSG),BC ;insert into string RST 8 ;display the message MSG EQU $ ;label MSG DEFM 'xx' ;actual string to display DEFB 0 ;terminator @SHOWST --------- Displays error message from disk I/O. Entry: A = error condition C = error occured during READ operation NC = error occured during WRITE operation Exit: Message is displayed to the screen ALL registers are preserved. NOTE: This is normally called through @BADRD, @BADWRT @SHOWWH --------- Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 35 Displays current Drive, Track, and Sector. Entry: (@DRIV) = current drive number DE = track sector Exit: "Drive x, Track xxx, Sector xxx." is displayed. ALL registers are preserved. LD A,1 ;drive 1 CALL @SETDRV ;set it up LD DE,0 ;track 0, sector 0 CALL @READ ;read the sector CALL NZ,@SHOWWH ;displays drive, track, sector CALL NZ,@SHOWST ;displays error condition @SHOWLF --------- Displays source of data. Use with @SHOW. If data from MEMORY, then address are displayed. If data from DISK, then drive, track, sector displayed. If data from FILE, then drive, track, sector, filename And relative sector in file are displayed. @MODTYPE --------- Fifteen byte string of Modify Mode number bases. Used by @SHOWLF to display current setting. "HEXDECBINOCTASC" @MODDRV --------- Ascii string for "DRV". (Used by @SHOWLF) @MODMEM --------- Ascii string for "MEM". (Used by @SHOWLF) @MODTRK --------- Ascii string for "TRK". (Used by @SHOWLF) @MODTRU --------- Ascii string for "TRU". (Used by @SHOWLF) @MODSEC --------- Ascii string for "SEC". (Used by @SHOWLF) @MODDAT --------- Twelve byte string for the different data address marks. Used by @SHOWLF. "STDRPTDDTUDF" @MXDDE --------- Ascii string for "ISD". (Used by @SHOWLF) Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 36 @MODIFY --------- Modify mode entry point. (Call @SHOW first to display) @MODFIX --------- Used by the flashing cursor routines in the modify mode To restore the 3 bytes being flashed to their normal setting. Entry: DE => current buffer address IX => current video location on HEX side of display. IY => current video location on ASCII side of display. Exit: Byte from (DE) is displayed to (IY), (IX), and (IX+1) Byte is adjusted first if encrypting is specified. @MODTBL --------- Table of vectors to be used by the modify mode when keys are pressed. @BLKS --------- Three bytes of 8FH (graphic blocks). Used as the cursor ON Character in the modify mode. @DECODE --------- Get keyboard input, and set decoding parameters. (Normally entered through @MODIFY when @ is pressed) @UPDATE --------- Entry point to update data when ENTER pressed in modify mode. If data is from disk, it will be written back. If data is from memory, it is already updated. @BADRDCLS --------- Clears the screen, calls @BADRD, clears the screen again and returns. A call is made here instead of @BADRD if the screen is filled with data, such as in Display Disk Sectors. @BADWTCLS --------- Same as @BADRDCLS, except a call is made here for Write error. @BADRD --------- Used after a disk Read error to display where the error occured, what type of error it was, and prompts for "Retry, Skip, Continuous, Nonstop, or Quit." Entry: A = error code DE = Track, Sector (@DRIV) = binary drive accessed If CLEAR key is pressed, turn off NONSTOP and CONTINUOUS Exit: If QUIT is selected, program branches to 4018H and returns to last sub-menu. If SKIP is selected, B register (buffer pointer) is Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 37 incremented, Z flag is set. If NONSTOP or CONTINUOUS is set, program returns with NZ flag set, and turn off prompting mode. If RETRY is selected, NZ flag is set. ROUTINE EQU $ ;start of routine LD A,1 ;use drive 1 CALL @SETDRV ;set it up LD DE,0 ;track 0, sector 0 LD BC,@BUFFER ;where to read it in CALL @READ ;read a sector CALL NZ,@BADRD ;if no good, go error JR NZ,ROUTINE ;if RETRY, read again @BADWRT --------- Same as @BADRD, except called after a bad Write operation. NOTE: @BADRD and @BADWRT can be DISABLED by inserting a C9H (RET opcode) into the first byte. Insert a 00H (NOP opcode) to ENABLE it. @INITBAD --------- Turns off CONTINUOUS mode in @BADRD and @BADWRT. Entry: NONE Exit: A is destroyed @INITBAD1 --------- Turns off NONSTOP, and ENABLES @BADRD and @BADWRT. Exit: A is destroyed @INITBAD2 --------- DISABLES @BADRD and @BADWRT. Exit: A is destroyed @ADJBYTE --------- Adjust a byte to the current DECRYPTING mode setting. (decrypting defined by setting @DISP1, @DISP2, and @DISP3) Entry: A = byte to be adjusted Exit: A = adjusted byte A' is destroyed @CKCONF --------- Check for Dos specifier. Entry: A = byte to be interpreted (A-J or a-j). Exit: NZ = invalid selection, ALL registers preserved Z = selection OK, B = Dos setting for @DENSELSET LD A,0 ;use drive 0 CALL @SETDRV ;set it up for use LD A,'A' ;set up for TRSDOS Mod I Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 38 CALL @CKCONF ;get byte from @DTTBL CALL Z,@DENSELSET ;insert byte into table @AASHOW --------- Saves current registers, forces prime registers, and call @SHOW to display a memory buffer. Entry: (@ADDRESS) = address to be displayed. Exit: BC, DE, HL, IX and IY are preserved AF, and ALL alternate registers are used @CKTRAKS --------- Checks input string for track count specified. Entry: HL => input string Exit: If (HL) = and equal sign (=), then @VALUE is extracted from following bytes. If VALUE is OK (no carry), then it is inserted into the @TRACKS table for the current drive. NOTE: This routine is called normally through @FIGDRV @SETSIDE --------- Checks for side 2 enable symbol. Entry: A = character to check Exit: If A = 27H ('), then side 2 ENABLED (Bit 6, table @TYPEB) If A <> 27H, then side 2 DISABLED NOTE: This is called normally through @FIGDRV @SHOREAD (RST 28H) --------- Displays "Reading Drive, Track, Sector", calls @READ. Entry: (@DRIVE) valid for current drive DE = Track/ Sector to read BC => Buffer address Exit: Z flag is set NOTE: If @READ is successful, then a RET is executed. If @READ is Bad, then a call to @BADRD is made. If SKIP is selected, the a call to @ADDCOUNT is made to bump an error counter. LD A,0 ;select drive 0 CALL @SETDRV ;set it up LD HL,20 ;20 sectors to read LD DE,0 ;track 0, sector 0 CALL @INITCNT ;zero the error counter LOOP EQU $ ;lable LOOP LD BC,@BUFFER ;where to load the data CALL @MREAD ;multiple read routine LD A,H ;check for any more OR L ;set flags for HL JR NZ,LOOP ;some more left CALL @SHOCOUNT ;display error counter Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 39 RST 8 ;display message DEFM 'Errors.' ;message DEFB 0 ;terminator @SHOWRITE (RST 30H) --------- Same as @READ, except @WRITE and @BADWRT are the vectors. @SHOVERFY --------- Same as @READ, except "Verifying Drive, Track, Sector" is displayed. @SHOVERFX --------- Same as @SHOVERFY, except a call is NOT made to @BADRD in the case of a disk error. Two attempts are made at a successful read. This routine is used when formatting a disk to detect bad sectors. @SHOFMT --------- Displays "Formatting Track xxx", and writes track to disk. Entry: Mod I, (37EDH) = current track number Mod III, port (F1H) = current track number (@FMTBUFF) = address of format data Exit: Z = successful write operation NZ = bad, error message is displayed. @VERSEC --------- Verify Disk Sectors entry point. @SHOACNT --------- Displays Counter B. @SHOCNT --------- Displays Counter A. @XCOUNT --------- Counter A string. @XACOUNT --------- Counter B string. @INITACNT --------- Zero's counter B. @INITCNT --------- Zero's counter A. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 40 @ADDACNT --------- Bumps counter B. @ADDCNT --------- Bumps counter A. NOTE: The above counters may be used as follows: Counter A is normally used as a disk I/O error counter. When calling @SHOREAD, etc. @ADDCNT is called whenever a disk sector is skipped (bad.) Counter B is user definable. When calling the bump counter routines, ALL registers are preserved. When the counters are displayed, ALL registers are preserved, and the cursor is left with one space following the number. A linefeed is displayed BEFORE the number. See @SHOREAD for an example of use. @GETCNT --------- Prompts for "Sector Count ?" Entry: (@DRIVE) is valid for current drive. Exit: HL = number of sectors specified. If no input is supplied (ENTER pressed only), then HL will be loaded with the total number of sectors on the diskette. A = L register (LSB of sector count) @CNTOTAL --------- Computes the total number of sectors on a disk. This is normally called through @GETCNT. Entry: BC is pushed on the stack from @GETCNT Exit: HL = sector count on the diskette LD A,0 ;use drive 0 CALL @SETDRV ;set it up PUSH BC ;must be on the stack LD HL,RETADD ;return address EX (SP),HL ;put on the stack PUSH HL ;put BC back CALL @CNTOTAL ;compute total RETADD EQU $ ;control resumes here @MVERIFY --------- Multiple sector read routine. Same as @MREAD, except "Verifying" is displayed. @MREAD --------- Multiple sector read routine. @SHOREAD is called to display the current sector being written. Entry: (@DRIVE) is valid for current drive Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 41 DE = Track, Sector to begin HL = Number of sectors to read Exit: @ADDCNT called once for each sector SKIPPED if read error. HL = number of sectors remaining to be read. NOTE: Top of memory is checked after each sector. Thus if more sectors are specified that can be held in memory, the routine will exit, and HL will contain the count of sectors remaining. See @SHOREAD for usage of this call. @MWRITE --------- Multiple sector Write operation. Same as @MREAD, except sectors are written to the disk from memory. @COMSEC --------- Compare Disk Sectors entry point. @COMPARE --------- Compares two strings. Entry: HL => source string DE => compare string B = length to compare Exit: Z = all bytes match HL => source string + length DE => compare string + length B = 0 NZ = mismatch HL => first mismatch source DE => first mismatch compare B = # bytes remaining to compare @IFSAME --------- Asks if disk mounts are to be prompted, and sets @MFLAG according to keyboard input. Entry: NONE Exit: If NO is selected, (@MFLAG) = -1 If YES is selected, (@MFLAG) = 0 @SMOUNT --------- Prompts for source diskette to be mounted. Entry: NONE Exit: If (@MFLAG) = -1 (NO), nothing is done. If YES, then prompt is issued to mount SOURCE diskette on the current drive, and program waits for ENTER key. @DMOUNT --------- Same as @SMOUNT, except DESTINATION disk is prompted for. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 42 NOTE: See @SSETUP and @DSETUP @DRVSAME --------- Source and Destination drives are compared. Entry: (@SDRIVE) and (@DDRIVE) are valid. Exit: Z = same drives NZ = different @PAUSE --------- Check for pause key. (spacebar) Entry: NONE Exit: If SHIFT SPACEBAR is pressed, wait till it is released. If SPACEBAR is pressed, wait till ENTER key is pressed. A is destroyed. @COPSEC --------- Copy Disk Sectors entry point. @ZERSEC --------- Zero Disk Sectors entry point. @WRITETR --------- Writes track of data from memory to disk. Entry: BC => buffer where track data is. (@DRIVE) is valid for selected drive. Head is over the correct track. Exit: Z = OK NZ = Bad, error code in A. (5 tries made) @DAMARKS --------- Read Data Address Marks entry point. @BUFFERND --------- Checks for buffer at top of memory. Entry: BC => current buffer pointer Exit: Z = at top of memory NZ = more buffer left LOOP EQU $ ;label LOOP PUSH HL ;save counter RST 28H ;read a sector POP HL ;restore counter JR NZ,QUIT ;Quit if no good CALL @NEXSEC ;bump sector pointer DEC HL ;check for # sectors completed LD A,H ;check for any bits on OR L RET Z ;all sectors done CALL @BUFFEREND ;any memory left? Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 43 RET Z ;done for now JR LOOP ;else go some more @EXCSEC --------- Exchange Disk Sectors entry point. @SECDATA --------- Exchange Disk Sectors entry point. @GETBYTE --------- Asks for "Relative Byte ?". Entry: NONE Exit: L = relative byte 0-FFH BC, H, A are destroyed. @GETBCNT --------- Asks for "Byte Count ?". Entry: NONE Exit: BC = byte count (defaults to 256 if ENTER pressed) A is destroyed, HL, DE are unchanged. @IFCLEAR --------- Checks for CLEAR key being pressed. Entry: NONE Exit: C = key is pressed NC = key NOT pressed A is destroyed @SWAPDAM --------- Exchange bytes in @DAMBUFF Entry: NONE Exit: First 128 bytes in @DAMBUFF are exchanged with the Second 128 bytes. This routine is called by @EXCSEC to swap the contents of the Data Address Mark buffer. A is destroyed. @SSETUP --------- Setup parameters for Source drive. Entry: (@SDRIVE) contain the current drive. Exit: (@DRIVE) and (@DRIV) are set for that drive. If (@MFLAG) is 0, then a prompt for SOURCE disk is issued. The disk status is then checked for ready via @STAT. Z = drive is mounted and door is closed. NZ = drive not mounted, and SKIP was selected. CALL @INITCNT ;clear the error counter CALL @SSETUP ;set up for source drive LD DE,0 ;read track 0, sector 0 Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 44 LD BC,@BUFFER ;where to read data RST 28H ;read from disk CALL @DSETUP ;setup for source drive DEC B ;BC = @BUFFER now RST 30H ;write same sector to another drive CALL @SHOCNT ;display error counter RST 8 ;display message DEFM 'I/O errors' ;message DEFB 0 ;terminator @DSETUP --------- Setup for Destination Drive. Same as @SSETUP except (@DDRIVE) is valid for drive to be used. @STRSER --------- String Search through disk entry point. @MSTRSER --------- String Search through memory entry point. @ASKSTRNG --------- Asks for string for above 2 routines. Entry: NONE Exit: Input MUST be made, ENTER alone is not accepted. If first characters are # or ##, then the VALUE of the following numbers are inserted into the string. If @ is specified, then the resulting string is decrypted to whatever the current settings are. (Call is made via @ADJBYTE to encode the string.) B = length of resulting input string. HL => string @ASKREPL --------- Asks for Replacement String, in conjunction with the above. Entry: NONE Exit: If ENTER pressed alone, then bit 2 of @FLAGA is RESET. If input is supplied, then the string is interpreted in the same manner as @ASKSTRNG, and bit 2 of @FLAGA is SET. @REVSEC --------- Reverse Disk Sectors entry point. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 45 @SWAP --------- A single page of memory is reversed (256 bytes). Entry: HL => page of memory to be reversed. Exit: 256 byte block of memory is reversed. A and A' are destroyed. @SECSER --------- Sector Search routine entry point. @IDMARKS --------- Read ID Marks entry point. @IDTABLE --------- Lookup table for responses to key input in @IDMARKS. @CKADDR --------- Reads ID address marks from disk. Entry: (@DRIVE) is valid for drive Head is positioned over the desired track. Exit: NZ and NC means data is valid. NZ and C means disk error during ID read. Z means track is possibly not formatted, but no error occured reading the ID @ONEDRIVE --------- One drive is prompted for, and @SETUP is set up. Entry: NONE Exit: If ENTER pressed alone, then drive 0 is defaulted. If input is supplied, then it is interpreted to setup the drive number, dos specifier if supplied, and track count if supplied. @ACOMPARE --------- Compares two strings, after being decrypted. Entry: DE => source string. HL => dest string, to be decrypted. B = length to compare. Exit: Z = strings match NOTE: A byte is taken from (DE), and a call is made to @ADJBYTE Then, the resulting byte is compared to (HL) @QCOMPARE --------- Compare two strings, pass over ? symbols. Entry: HL => source string DE => destination string B = number of bytes to compare Exit: Z = all bytes match Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 46 NZ = does not match NOTE: Any ? symbols found in the source string (HL=>), then they are not compared. Thus, all ? characters in the source string will match anything in the dest string. This is used with the String Search routines. @DISMEM --------- Display Memory entry point. @DOADDR --------- Display memory pointed to by BC. Entry: BC = address to be displayed. Exit: (@ADDRESS) = (BC), and the data is displayed to the screen. @DISMTBL --------- Lookup table for responses to Display Memory. @GETADDR --------- Prompt for "Address ? ". Entry: NONE Exit: BC = Input value If ENTER is pressed alone, then (@DEFADDR) is used as the default value. @DOBUILD --------- Build Track to Memory entry point. @GETSES --------- Prompt for "Start, End, Start ?". Entry: NONE Exit: (@TEMP0) = Start (default = @PGMEND) (@TEMP1) = End (default = (@TOPMEM)-1) (@TEMP2) = Start (default = @PGMEND) @GETSE --------- Prompt for "Start, End ?". Entry: NONE Exit: (@TEMP0) = Start (default = @PGMEND) (@TEMP1) = End (default = (@TOPMEM)-1) @MOVMEM --------- Move Memory entry point. @EXCMEM --------- Exchange Memory entry point. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 47 @REVMEM --------- Reverse Memory entry point. @JUMPMEM --------- Jump to Memory entry point. @FILLMEM --------- Fill Memory entry point. @COMMEM --------- Compare Memory entry point. @TESTMEM --------- Test Memory entry point. @INPORT --------- Input Byte from Port entry point. @OUTPORT --------- Output Byte to Port entry point. @MEM2SEC --------- Memory to Sectors entry point. @SEC2MEM --------- Sectors to Memory entry point. @PUTBUILD --------- Write Format Track entry point. @MEM2TRK --------- Memory to Track entry point. @TRK2MEM --------- Track to Memory entry point. @GETDT --------- Prompt for "Drive, Track ?". Entry: NONE Exit: (@DRIVE) and (@DRIV) are set (0 is defaulted) D = Input Track (0 is defaulted) @BUILDPUT Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 48 --------- Writes a formatted memory buffer to a disk track. Entry: (@FMTBUFF) = address of data Head is positioned over correct track. (@DRIVE) = drive to be used. @SHOFMT is used to display the drive and track. Exit: Z = OK NZ = Bad, error message is displayed. @SETIBM --------- Prompt for "IBM format ?" Entry: NONE Exit: Sets up @RDTYPE and @WRTYPE according to supplied input. IBM YES is defaulted if ENTER is pressed alone. @SFMTW --------- Standard Format Without Erase entry point. @SFMT --------- Standard Format entry point. @GETDRVS --------- Prompt for "Drive(s) ?" Entry: NONE Exit: Input string is scanned for multiple drive inputs. Bit 3 of the corresponding @TYPEB byte is set to activate the selected drive. String is handled via @FIGDRV so parameters such as Dos specifier and track counts may be interpreted. @GETNMDT --------- Prompt for Name, Date, and Password. (for formatting) Entry: NONE Exit: (@GATBUFF+D0H) = 8 byte name (@GATBUFF+D8H) = 8 byte date (@GATBUFF+CEH) = 2 byte encoded password. NOTE: If ENTER pressed alone for the above, the corresponding positions are not changed. Call @INITGAT for initial set up. @INITGAT --------- GAT table is initialized. Entry: (@DRIV) is valid to fetch Dos specifier. Exit: First the entire buffer (256 bytes) is filled with FFH. (sector filled with 00H for TRSDOS III) Then, starting at @DEFGAT, 21 bytes are moved into the GAT table starting at @GATBUFF+CBH. Then an 0DH is left at (@GATBUFF+E0H) NOTE: See @FILLGAT and @MAKEGAT Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 49 @DEFGAT --------- Twenty One bytes of GAT table initialization data. The bytes and their corresponding locations in the GAT: 21H => @GATBUFF+CBH = 2.1 version number for SU+ 0000H => @GATBUFF+CCH = 2 bytes of 0 (used in DOS+, LDOS, DoubleDOS) 42E0H => @GATBUFF+CEH = 2 byte encoded password (@FMTNAME) => @GATBUFF+D0H = 8 byte disk name (@FMTDATE) => @GATBUFF+D8H = 8 byte disk date @FMTNAME --------- Eight byte string of the default name for Format. @FMTDATE --------- Eight byte string of the default date for Format. @SPACES --------- Thirty two spaces. (20H) @FORMIT --------- Formats an entire disk. Entry: (@DRIVE) and (@DRIV) valid for drive to be used. (@STARTTRK) is valid for track where formatting is to begin. (@FMTYPE) = 1 if format without erase (@IFVERF) = 0 if disk is to be verified, else 0 Exit: If (@FMTYPE) = 2, then a RET will be executed after the disk is formatted without verifying. If anything else, the disk will be verified (if (@IFVERF) =0), then the BOOT and DIRECTORY will be written to the disk. @STARTTRK --------- Holds the number of the track where formatting is to begin. NOTE: The user may format any number of tracks, anywhere on a disk. For example, to format tracks 21-27 only, set the track count to 28, and the starting track to 21 before calling @FORMIT. @FMTYPE --------- Flag which identifies the calling vector to @FORMIT. 0 = Standard format 1 = Format without erase 2 = Standard disk copy (returns after formatting) @IFVERF --------- If a Verify is to be performed on a formatted disk. 1 = skip verify phase, anything else will verify. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 50 NOTE: If (@FMTYPE) = 2, then NO verify is attempted, even if (@IFVERF) indicates a verify. @BUILDTRK --------- Build a format track in memory. Entry: (@DRIV) is valid for current drive. (needed to fetch the correct dos specifier byte from @TYPEA table) (@FMTBUFF) is the address where the data is to be placed. Mod I, (@37EDH) = current track number. Mod III, (port F1H) = current track number. Exit: Data is stored in to memory buffer at specified address. AF, BC, DE, HL are used. @MOVEIN --------- Takes a length and fill byte pointed to by DE, and fills into a memory buffer pointed to by HL. Entry: DE => 2 bytes, length and fill byte HL => memory buffer address Exit: Address pointed to by HL is filled with bytes specified by 2 byte table pointed to by HL HL => next address DE => next byte in table B = 0 A = fill byte used LD DE,TABLE ;point to table LD HL,@BUFFER ;point to buffer CALL @MOVEIN ;fill the buffer JP CONT ;continue here TABLE EQU $ ;table starts here DEFB 33 ;33 bytes to be filled DEFB 07 ;fill byte is 7 @FILL --------- Fills buffer pointed to by HL with B bytes of A. Entry: HL => buffer to be filled B = number of bytes to fill A = byte to fill with Exit: HL => next byte in buffer A = byte used for fill B = 0 LD HL,@BUFFER ;point to buffer XOR A ;set Accumulator to 0 LD B,0 ;# bytes to fill CALL @FILL ;fill it up After this routine, HL = @BUFFER+100h, and @BUFFER through @BUFFER+0FFH will be filled with 0's. @ORDER --------- Table of information used in formatting SINGLE DENSITY. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 51 @DORDER --------- Table of information used in formatting DOUBLE DENSITY (NOT TRSDOS Mod III) @DORDER2 --------- Table of information used in formatting DOUBLE DENSITY (For TRSDOS Mod III) NOTE: The above 3 tables contain the following information. +0 = number of sectors on a track +1+2 = address of table of the order of the sectors on a track +3+4 = post-index gap length, fill byte +5+6 = pre ID sync field +7+8 = pre ID sync field +9+10 = gap between ID and DATA fields +11+12 = pre DATA sync field +13+14 = pre DATA sync field +15+16 = post DATA gap length, fill byte @ORDERS --------- Ten byte table of the order that sectors are to appear on a track when it is formatted. @ORDERD --------- Eighteen byte table of the order sectors appear on a double density (NON TRSDOS III) track. @ORDERD2 --------- Eighteen byte table of the order sectors appear on a double density TRSDOS Mod III track. NOTE: The sectors on a track are not in sequential order for maximum read times. If you examine the tables, you will see that a track can be read in 2 revolutions on single density and 3 revolutions on double density. See @ORDNEW for sector skewing information. @HASDATA --------- Before a disk is formatted, an attempt is made to read track 0, sector 0 (sector 1 on TRSIII). If it is readable then a call is made here. An attempt is made to read the directory. If it is NOT readable, an appropriate message is displayed. If it IS readable, the directory name and date will be displayed. The user is then prompted to Continue or Quit. If quit is selected, then an exit is made to 4018H to return to the last sub-menu, else a RET is executed. @CODE Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 52 --------- Codes an ascii string into a two byte password. Entry: HL => input string to be encoded. B = length of the input. (@TYPEA) bit 3 defines which encoding scheme to be used. (Mod III TRSDOS or all others) Exit: HL = 2 bytes password AF, BC, DE are destroyed NOTE: All operating systems use the same encoding scheme EXCEPT TRSDOS III. @GET10 --------- If format without erase is selected, then a call is made here before formatting each track to read a full track of data into a memory buffer. @PUT10 --------- If format without erase is selected, then a call is made here after each track is formatted to write the previously found data back on the track. These 2 calls are normally made through @FORMIT. @ORDNEW --------- Shifts the current sector order table for sector skewing. If single density, 3 rotations are performed, else 4. NOTE: In order to make a disk readable in the fastest manner, it is important to consider the step time involved from track to track. A single turn of the disk takes 200 ms. At a 40 ms step rate (slowest), 1/5 of the disk will turn by before the step command has completed. If the sectors appear in the same order on every track, then the remaining 4/5 revolution must be made to come back around to the first sector on the next track. Using the technique applied here, the first sector on each successive track will be located 3/8 of a revolution ahead of the last track, so that when the step command has completed, the first sector will be positioned properly. @NSBOOT --------- NON-SYSTEM boot that is written to a disk during the format process. If the disk is booted on drive 0, then a message informing the user that the diskette does not contain a system is displayed, and the program halts. @BOOTENT --------- Directory entry for BOOT/SYS, applied during format. @DIRENT --------- Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 53 Directory entry for DIR/SYS, applied during format. @SFMT3 --------- Normal exit address for format and backup to ask if another copy is requested. If NO, then an exit to 4018H is made to return, if YES, then another copy is made. @LOKIT --------- Locks out current granule when error detected during verify phase on disk formatting. Entry: DE = track/sector Exit: Gat table located at @GATBUFF is updated to reflect the locked out granule. DE = first sector AFTER the current granule. @FILLGAT --------- Prepares a GAT table in memory. Entry: HL => 256 byte buffer Exit: All bytes to relative byte CDH are affected. Bytes CEH - FFH are unchanged. Complete GAT and Allocation tables are constructed. All tracks are marked as available. BC are destroyed. @DDOSTRKS --------- Computes the RELATIVE track count of a diskette. Entry: NONE Exit: A = relative track count of diskette. NOTE: If bit 4 of the corresponding byte in @TYPEA is reset, a jump is made to @GETTKS. The TRUE and RELATIVE track counts for a diskette are always the same EXCEPT with DoubleDOS and ND80. The RELATIVE track count is computed as DISK RELATIVE SECTORS. If the TRUE track count is desired (such as when formatting) then a call to @GETTKS should be made. The RELATIVE track count is needed when stepping through a disk via sector read/writes (@DDOSTRACKS is called by @NEXSEC). @LOKGRAN --------- Performs the actual GAT table track lockout. Entry: DE = current track sector Exit: The granule pointed to by DE is locked out on the GAT table located at @GATBUFF. A is destroyed. @NEXGRAN --------- Advances DE to the first sector in the following granule. Entry: DE = track sector Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 54 Exit: DE = first sector in next gran. B is destroyed. @BULKGO --------- A call here will completely bulk erase a disk. Entry: (@DRIV) valid for desired drive. Exit: Z = OK NZ = not completed. NOTE: This routine can be fatal to a diskette! A stream of 0's are written to every track on the diskette to erase all data! @BULKERSE --------- Diskette bulk erase entry point. @UFMT --------- Special format utility entry point. @RANDOM --------- Compute a pseudo-random number. Entry: NONE Exit: A = pseudo-random number from 0-255 inclusive. @PREGAP --------- Prepares a POST-INDEX gap in memory for formatting. Entry: (IY) Bit 7 = 1 = double density Bit 7 = 0 = single density HL => current buffer pointer Exit: 1FH bytes of FFH for S/D. 3EH bytes of 4EH for D/D. @SECGAP1 --------- Prepares a PRE-ID gap for formatting. Entry: same as @PREGAP Exit: 6 bytes of 0 for S/D. 0CH bytes of 0, 3 bytes of 0F5H for D/D. @SECGAP2 --------- Prepares a PRE-DATA gap for formatting. Entry: same as @PREGAP Exit: 0BH bytes of FFH, 6 bytes of 0 for S/D. 16H bytes of 4EH, 0CH bytes of 0, 3 bytes of F5H for D/D. @POSTGAP --------- Prepares a PRE-INDEX gap for formatting. Entry: same as @PREGAP Exit: FFH bytes of FFH for S/D. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 55 FFH bytes of 4EH for D/D. @FILLDATA --------- Prepares the DATA segment for formatting. Entry: (IX+1) Bit 7 = 1 = Use IBM format Bit 7 = 0 = Use NON-IBM format (IX-1) = sector length (0-255) HL => current buffer Exit: The length of the sector is computed, and the resulting number of bytes are loaded with 00H. @SPATTERN --------- DATA pattern to be used in single density. NOTE: This is a 16 byte string, and is duplicated 16 times when formatting a 256 byte sector in S/D. @DPATTERN --------- DATA pattern to be used in double density. NOTE: This 16 byte string is duplicated 16 times to fill 256 bytes of data during formatting. NOTE: SU+ comes initialized with E5H for single density, and 6DB6H for double density. These have proven to be worst case patterns, and will result in a maximum number of formatting failures. The logic behind this is that a marginal disk should be revealed during the format process than after valued data is on the disk. @CLRBUFF --------- Zeroes out a format buffer prior to building the track data. Entry: (@FMTBUFF) = format buffer to be used. Exit: 2000H bytes of 0's written to the indicated buffer. DE and BC are destroyed, HL is preserved. NOTE: It is good practice to clear out a format buffer prior to building the track data. If a short track is prepared and there is any extraneous data after the buffer, it too will be written to the disk and possibly picked up by the FDC during a sector read operation. @COMPCODE --------- Computes the difference in password encoding between TRSDOS III and all others. NOTE: This routine is called by @CODE. All DOS's use a common password encoding scheme for compatability EXCEPT TRSDOS III. The coding method is identical except for 2 bytes. @CODE calls @COMPCODE to execute the proper 2 byte instruction. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 56 @DISPNMDT --------- Displays disk name and date. Entry: @GATBUFF + D0H-DFH hold the current name/date. Exit: Name and Date are displayed on the video. NOTE: The name and date are checked prior to displaying. If any bytes are less than 20H (control codes), then the data is considered non-standard and a message "Invalid Name/Date Data" is displayed. @WHEREDIR --------- Computes the directory location on a disk. This routine is called by @RDDIR. If the disk is specified as DoubleDOS, then track 17 is returned. (DoubleDOS MUST have directory on 17) Else track 0, sector 0 (sector 1 Mod III disks) is read. The 3'rd byte (2'nd byte TRSDOS III) is fetched as the location of the directory. The resulting byte is checked and must be from 1-191 to indicate the real range of allowed directory tracks. If the byte is outside this range, then 17 is returned. @RDDIR --------- Read a directory into memory. Entry: (@DRIV) valid for desired drive. Exit: Directory is read into memory. C = read error, or invalid sector count. Z = no sectors read into memory. NZ and NC = successful. (@DIRCOUNT) = sector count of the directory. DATA starts at @GATBUFF NOTE: First, the track indicated by the current table setting at @DIRTRK is read in. If it is a read protected sector (NON-read protected TRSDOS III), then the read continues. If not valid, a call is made to @WHEREDIR to determine the location of the directory, and the table is updated. If the new track does not meet the read-protect status, an error return is made. Successful sectors are read in until the end of the track is reached. If single density or ND80 DD is set, then sectors reads are continued until the first non read-protected sector is found. This is so that SU+ can read in extended directories created by ND80 in either single or double density. @WRDIR --------- Writes the last directory read in back to the disk. Entry: (@DIRTRK) holds the current directory track. (@DRIV) = current drive number. (@DIRCOUNT) = number of sectors to be written. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 57 @GATBUFF = starting address of data. Exit: Z = OK NZ = Error @SHOWDIR --------- Full screen display of a directory block. Entry: Directory data begins at @GATBUFF (@DIRPAGE) holds starting sector -2. Exit: All files in 8 continuous sectors are displayed. NOTE: There is only room on the screen to display 64 files at the same time. Since double density disks and those with extended directories can hold quite a few more, a block of 8 sectors is displayed at a time. Usually (@DIRPAGE) is advanced by 8 sectors at a time. @SHOWIT --------- Displays a single filename to the video. Entry: IX => first byte of directory entry HL = video address where to display Exit: Z = filespec OK NZ = invalid filespec, not displayed NOTE: This is a useful call to determine if a directory entry contains a valid entry. Load HL with 0 if you want to determine the entry status, but not display the name. This call will display a killed file also. @DSKDIR --------- Display Disk Directory Entry Point. @DIRPART --------- Displays disk name, date, free grans, free files. Entry: Directory must already be in memory Exit: Diskette data displayed to video. @BUMPDE --------- Increments DE'. @GETGATCT --------- Computes number of free granules from GAT table. Entry: HL => GAT table B = diskette track count A = D4H if OFF bits to be counted A = DCH if ON bits to be counted Exit: DE = sum of counted bits (@FREEG) = (DE) @CHDNAME --------- Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 58 Change disk name entry point. @PUTNMDT --------- Writes GAT table to a disk. @ZUNUSE --------- Zero unused directory entries entry point. @DIRLIST --------- Displays a directory. Indicates if a file is Invisible, System, and the Protection Level setting. @ALINE --------- Line counter routine to prevent scrolling. NOTE: Whenever a long listing is being presented to the video screen, a call to @ALINE should be made with each linefeed. The program will pause when the screen is filled and wait for the ENTER key. @MODFYDIR --------- Entry point to the full screen 'purge/restore' utility. A directory is read into memory, and the files are killed/restored individually. @MODKILL --------- Subroutine to kill a file from @MODFYDIR. Entry: IX => directory entry of file to be killed. Exit: File is killed, and screen is re-draw via @SHOWDIR. @PUTBAKDR --------- Prompts if directory is to be written back. Entry: NONE Exit: Screen is cleared, and user prompted if directory is to be written back. If yes, a call to @WRDIR is made, else a RET is executed. @KILLIT --------- Kills a file from a directory. Entry: IX => first byte of directory entry Exit: File is killed. NOTE: This routine will only reset bit 4 of all active primary and extended entries. The grans are not released. A call to @MAKEGAT will free up the allocated grans. @KILLW Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 59 --------- This address holds the address of the beginning of the buffer area where the filenames reside. @KILLIT uses this address to compute the location of an extended directory entry. @RESTORIT --------- Same as @KILLIT, except the file is restored. @CLEARUNS --------- Zeroes out all non-active directory entries. Directory must already be in memory. @ZERFILE --------- Zero out a single directory entry. Entry: IX => beginning of directory entry. Exit: All bytes contained in the specified entry are set to 0. @RSYST --------- Remove system files entry point. @GETENTRY --------- Computes the number of directory entries in the current directory in memory. Entry: NONE Exit: DE = number of directory entries. HL, BC are destroyed. @RPASSW --------- Remove passwords entry point. @CLRFILEX --------- Zero's out a single directory entry. Entry: IX => first byte of directory entry Exit: primary and all extensions belonging to the specified file are zeroed. @MAKEGAT --------- Construct a GAT table. Entry: Directory located in memory starting at @GATBUFF. Exit: Complete GAT table reconstructed. NOTE: This routine will first make a call to @FIGTRAKS to establish the current track count of the diskette. If you wish to reconstruct the directory with a different track count, make the call to @MAKEGAT+3. All files in the directory are allocated. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 60 @ALLOCATE --------- Allocates grans belonging to current file. Entry: IX => directory entry Exit: All grans associated with this entry are allocated. Only the current entry is operated on, extensions (if any) are ignored. CALL @ONEDRIVE ;ask for a drive CALL @RDDIR ;read the directory CALL @DIRPART ;display name, date, free CALL @INITGAT ;clear out GAT table CALL @GETENTRY ;compute number of entries LD IX,@GATBUFF+200H ;start of filenames LOOP EQU $ ;where to loop BIT 4,(IX) ;active entry? CALL NZ,@ALLOCATE ;allocate this entry CALL IXDIR ;point to next entry DEC DE ;reduce counter LD A,D OR E ;any bits left? JR NZ,LOOP ;continue if not done @TOPGRAN --------- Computes highest bit positon for usuable grans. Entry: NONE Exit: A' = bit set for highest gran on track. @MAKEHIT --------- Completely rebuilds HIT table starting at @GATBUFF+100H. NOTE: The entire table is zeroed out and re-constructed from scratch. On TRSDOS III, the last 32 bytes in the sector are not affected as this is the system file allocation table. @HASH --------- Compute HASH code for a filename. Entry: IX => first byte in directory record. Exit: A = hash code byte. All other registers preserved. @PUTHIT --------- Insert HIT byte into table. Entry: IX => directory record. HIT table starts at @GATBUFF+100H. Exit: All corresponding HIT bytes for the associated file are inserted into the table. File extensions if any are taken care of also. @DISKFREE --------- Free Grans routine entry point. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 61 All 4 drives are scanned, and if a directory is found, the name, date, and free grans/files are displayed. @KILLCATG --------- Kill Files by Category entry point. @FIGTRAKS --------- Computes the track count of a diskette from the GAT table. NOTE: If ND80 or TRS III is indicated, the track count cannot be interpreted from the GAT table and must be entered explicitly. If DoubleDOS, the track count byte is @GATBUFF+CDH. If LDOS, track count is at @GATBUFF+CCH minus 35. If none of the above, the LOCKOUT table is scanned backwards for the first non-locked out track. This is then assumed to be the track count of the diskette. A call is usually made here after a directory has been read in to establish the actual track count in case it is different than the last one read. @COMPDIR --------- Compute the correct command to write a directory sector. Entry: (@DRIV) = drive to be written to. Exit: A = command for FDC @COMPDATA --------- Compute the correct command to write a data sector. Entry/Exit: Same as @COMPDIR NOTE: There are several different ways that the floppy disk controller (FDC) can mark sector data on a disk. Normally, the data and the directory are written with different data address marks (DAM) to help identify that a directory is actually read in. Normally, the data is written as STANDARD, and the directory as READ PROTECTED. This doesn't mean that it can't be read, but is simply a bit on the disk that can be identified. TRSDOS Mod III has the marks BACKWARDS. That is, DATA sectors are read protected, and the directory is standard. Making a call to @COMPDIR and @COMPDATA assures that the correct write command will be issued to the FDC. @CHFILE --------- Change file parameters entry point. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 62 @BUMPB --------- Increments B register. Normally used to count bits. LD C,8 ;count 8 bits in A LOOP EQU $ ;loop label RLCA ;shift bit from 7 to carry CALL C,BUMPB ;add count if set DEC C ;reduce counter JR NZ,LOOP ;do all 8, B has count @BCDIR --------- Loads BC with displacement between filenames. Entry: (@DRIV) = current drive Exit: BC = 30H for TRSDOS III BC = 20H for all others. @IXDIR --------- Advances IX pointer to next directory record. @HLDIR --------- Advances HL pointer to next directory record. @IXDIRB --------- Moves IX pointer BACKWARD to next directory record. NOTE: The directory is normally arranged with each record being 32 bytes long, and 8 per sector. On TRSDOS III, the directory records are 48 bytes long, and 5 per sector. The last 16 bytes in each sector is unused. Calls to the above will move the pointer correctly to the next file record. CALL @ONEDRIVE ;ask for a drive CALL @RDDIR ;read the directory JP C,4018H ;not a directory, abort to JP Z,4018H ; last sub-menu CALL @INITCNT ;zero the counter CALL @GETENTRY ;compute number of directory records LD HL,@GATBUFF+200H ;start of filenames LOOP EQU $ ;loop label BIT 4,(HL) ;active record? CALL NZ,@ADDCNT ;bump counter if active CALL @HLDIR ;point to next record DEC DE ;reduce counter LD A,D OR E ;any bits left? JR NZ,LOOP ;do the rest CALL @SHOCNT ;display the counter RST 8 ;display message DB 'Active Records.',0 Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 63 JP @GOBACK ;press to continue @RPDIR --------- Read Protect Directory entry point. @URPDIR --------- Un-Read Protect Directory entry point. @REPGAT --------- Repair GAT table entry point. @REPHIT --------- Repair HIT table entry point. @REPBOOT --------- Repair BOOT sector entry point. @REPCOMM --------8 Execute common subroutine for all activated drives. Entry: HL = subroutine address. Exit: branch to @GOBACK made when all drives completed. @GATREP --------- Code to repair GAT table. Vector from @REPGAT via @REPCOMM. @HITREP --------- Code to repair HIT table for each drive selected via @REPCOMM. @BOOTREP --------- Code to repair BOOT sector for selected drives via @REPCOMM. @ZUNGRANS --------- Zero Unused Granules entry point. @ZEGRAN --------- Zeroes current granule DE points to. Entry: DE = current track sector Exit: Gran containing sector pointed to by DE is zeroed. Z = OK NZ = Error, code in A. @GRNSIZE --------- Compute number of sectors per granule. Entry: (@DRIV) = current drive Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 64 Exit: B = # sectors per gran. A is destroyed (= byte from @TYPEA) @NEXEGRAN --------- Advances DE to start of next granule. Entry: DE = current track/sector. Exit: DE = starting sector of following granule. @CHKDIR --------- Check Directory Entry Point. @MOVEDIR --------- Move Directory entry point. @MANYGRNS --------- Returns a mask byte in E. Off bits indicate a gran is available in the current operating system. Entry: NONE Exit: E = mask byte, set bits cannot be used as a gran. @SCOPY --------- Standard Disk Copy entry point. @ASKIFFMT --------- Prompt if destination disks are to be formatted. Entry: NONE Exit: (@IFBFMT) = 1 = YES, format (@IFBFMT) = 0 = NO, don't format @REMDRIVE --------- Removes the current drive from the active table. Entry: (@DRIVE) = current drive Exit: Bit 3 of the corresponding @TYPEB table is reset. @UPDIRX --------- Updates GAT table in memory to track count specified by (@TRACKS), and then updates to the current disk. Entry: Directory in memory starting at @GATBUFF Exit: GAT table re-created to the track count indicated by (@TRACKS), and is then written back to disk. NOTE: This is the normal exit for Format Without Erase, and Standard Backup to unlike track counts. If a 40 track diskette is copied to an 80 track formatted disk, the additional 40 tracks are opened up and made available to the users operating system. @UCOPY Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 65 --------- Special Disk Copy entry point. @SHOMNY --------- Used by special disk copy. This call displays the current new data when scanning a disk prior to the copy. @GOGOCOPY --------- This routine will format a non-standard disk. The disk must already have been pre-scanned, and the table of data must have been created starting at @DAMBUFF. NOTE: The format of the table to copy special disks is as follows: Each track has the following format for the number of tracks indicated by (@TRACKS). First byte, bit 7 = 1 = double density track bit 7 = 0 = single density track bits 6-0 = # of sectors on this track. Then follows 6 bytes for each sector on the track. First byte = Track Number. Second byte = Head Number. Third byte = Sector Number. Fourth byte = Sector length. Fifth byte = result of sector being read in. NOTE: The fifth byte for each sector is used to determine the IBM status of a sector. False sectors cannot be duplicated. @PERCOPY --------- Transfers a full non-standard disk a sector at a time. Uses the table built via special copy to determine the sectors to be transferred. A call to @GOGOCOPY is made prior to @PERCOPY to format the disk first. @COMPPASS --------- Encode/Decode Password entry point. @FIGPASS --------- Computes a password. Entry: DE = password to be computed. Exit: 8 byte ascii string displayed showing a working password. @DRVSTATS --------- Drive Status entry point. @DRVCHK --------- Display's the status for a single disk drive. Entry: (@DRIV) = current drive Exit: Message displayed if disk is mounted, empty, etc. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 66 @FILEMAP --------- Disk Allocation entry point. @FILETOTL --------- Displays relative data found in a files directory entry. Entry: IX => first byte of a directory record. Exit: Filename, Track, Sector, Byte and DEC of the current record. @FILEMORE --------- Displays relative data found in a directory record. Entry: IX => directory record. Exit: End of file sector (EOFS), End of file byte (EOFB), Logical record length (LRL), encoded passwords, # grans, and all extents belonging to a directory record displayed. @SHOEXTS --------- If a directory record has an extended entry, a call here will display the data located in it. @DISFILE --------- Display File Sector entry point. @BADFILE --------- Displays 'Invalid Filespec.' message. @NOFILE --------- Displays 'File Not Found' message. @SHOWFL --------- Displays a files sectors data on the video screen. Filename and relative sector are indicated. @DISFLTBL --------- Lookup table used in response to keys pressed in display file sectors. @CKASCI --------- Checks to see if a character is a valid filename character. Entry: A = character to be checked. Exit: C = invalid character NC = OK @CKASCIL --------- Checks to see if a character is a valid filename Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 67 character in the first character position. Entry/Exit: Same as @CKASCI @MOVEFILE --------- Takes an ascii filename string, and moves it into the file device control block (DCB). Entry: HL => ascii filename. Exit: C = invalid filespec NC = OK If OK, filename is moved to @FILEDCB in the same configuration as it would be found in the directory. Eight byte filename padded with blanks followed by the 3 byte extension padded with blanks. If a password was specified, it is moved to @PASSWORD, although it is never checked for validity. If a drive was specified, (@DRIVE) and (@DRIV) will be updated, and (@SCANFLAG) will be set to 1 to disable a drive search. If a drive is NOT specified, (@SCANFLAG) is set to 0 to enable a drive search. @FINDFILE --------- Locates a filespec in a directory. Entry: Filename must have been pre-moved to @FILEDCB Exit: C = file not found NC = file found. If found, directory will be in memory and IX will point to the directory record. BEGIN EQU $ CALL @ASKFILE ;ask for filename from keyboard CALL @MOVEFILE ;move to DCB CALL C,@BADFILE ;invalid filespec JR C,BEGIN ;ask again CALL @FINDFILE ;locate the file CALL C,@NOFILE ;file not found JR C,BEGIN ;ask for another LD HL,(@CURSOR) ;get current cursor position CALL @SHOWIT ;display the name @RELSEC --------- Displays EOF sector and EOA sector for a file. Entry: IX => directory record Exit: EOF and EOA displayed to video. @POSIT --------- Position to a relative sector in a file. Entry: (@TEMP9) = sector to position to IX => first byte in directory record. DE = address of first directory record (@GATBUFF+200H). Exit: C = sector is beyond file limits NC = OK DE = track, sector of requested position in file. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 68 @POSITBC --------- Position to relative file sector. Entry/Exit: Same as @POSIT, except relative sector is supplied in BC register instead of (@TEMP9). @GRANSIZE --------- Compute # of sectors in a granule. Entry: (@DRIV) = current drive Exit: A = # sectors per granule. @FSECTOR --------- Sector Allocation entry point. @WRLNO --------- Converts a 2 byte hex number to decimal ascii. Entry: HL = 2 byte word in HEX IY => 5 bytes where string is to be written. Exit: 5 byte ascii string written to (IY) DE destroyed LD HL,(@TEMP9) ;fetch a number LD IY,(@CURSOR) ;write to current cursor location CALL @WRLNO ;ascii string displayed on video @OFFSETFL --------- Offset Disk File entry point. @SHOWOFF --------- Displays module load range and entry point. Called by @OFFSETFL to display the current setting. @ASKFILE --------- Prompts for a filespec to be entered from keyboard. @CLEARFIL --------- Clear File Sector entry point. @COPFILE --------- Copy Files entry point. @IFCOPY --------- Displays a filename and asks if it is to be copied. Entry: IX => file directory record. Exit: If YES selected, nothing is done. If NO selected, the file is killed from the directory Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 69 in memory. @PERCOPY --------- Performs the copy of files after they have all been selected. @ALLO00 --------- Allocates all granules of a file. Entry: IY => first byte in filename. Directory begins at @GATBUFF. Exit: All grans assigned to the file are allocated. Extensions are allocated also. IY unchanged, BC, HL destroyed. @NEXEXT --------- Called by @ALLO00 to create a file extension if more directory records are needed. Entry: IY => first byte of existing directory record. Directory must start at @GATBUFF Exit: Extension is created. IY => first byte of extension. All links forward and backward are maintained. @COMFILE --------- Compare Files entry point. @CHUNK --------- Allocate granules to a file. Entry: Directory begins at @GATBUFF B = total number of grans needed. Exit: C = number of continuous grans (1 directory extent) HL, DE destroyed. Carry = directory full (all grans allocated) @FINDSPOT --------- Locates an empty directory record. Entry: Directory at @GATBUFF (@FINDSPOT+1,+2) = # available records in directory (result of a call to @GETENTRY) Exit: HL => empty directory record. Z = OK NZ = no more records available @EXECOPY --------- Called by @COPFILE. Performs the allocation of a file. @CREATFIL --------- Build File entry point. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 70 @ALLOCTNS --------- Disk Allocation entry point. @COMPGRNS --------- Computes the number of grans in a file. Entry: IX => directory record Exit: C = # of grans assigned to a file @DISPGRNS --------- Computes and displays the number of grans in a file. Entry: IX => directory record Exit: "xxx Grans." displayed. NOTE: A call is made to @COMPGRNS from this routine. @COMPHASH --------- Compute Hash Code entry point. @COMPADD --------- Adjust the number of grans found in a directory record. Entry: A = number of grans read from a directory record. Exit: A = actual number of grans in the record. LD A,(IX+23) ;fetch # of grans/start gran AND 1FH ;mask the number of grans CALL @COMPADD ;adjust to real number NOTE: On all DOS's except TRSIII, the right 5 bits = the number of continuous grans in a record -1. In TRSIII, the number is actual, and not -1. If the TRSIII bit in @TYPEA is set, then the number is NOT adjusted, otherwise it is incremented by one. @TAPECOPY --------- Copy Tape entry point. @PULSE --------- Used by @TAPECOPY. Reads one bit in from a tape recorder, and immediately writes it back out to the same deck. @TAPEIN --------- Reads one byte from tape. Entry: Tape is running Exit: A = byte input from tape. @BITIN --------- Called by @TAPEIN 8 times to read one byte. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 71 @TAPEOUT --------- Writes one byte to tape. Entry: Tape deck on. A = byte to write. Exit: C = key pressed. @SENDPIP --------- Called by @TAPEOUT 8 times to write one byte. @ASKDECK --------- Asks which deck is to be used (1 or 2), then prompts to press when tape is prepared. NOTE: The Mod III has only one deck, and therefore the deck prompt is skipped, and is prompted for. @TPROMPT --------- Prompts to press to begin. When enter is pressed, message press to terminate is displayed. @TAPEINIT --------- Sets up parameters used by tape input/output. Entry: NONE Exit: HL = 3840H (for key checks) DE = @DAMBUFF (where data is read from/ written to IY = 3C00H+896 (for data display on video) HL' = 0 DE' = 0 A = 0 @FINDSYNC --------- Displays "looking for sync", and jumps to @TAPELDR. @TAPELDR --------- Turns on tape deck, and reads leader and sync byte. @TAPESHOW --------- Displays data read from/ written to tape. Entry: HL' = checksum DE' = byte counter A = input/output byte IY => current video display location. Exit: Byte counter is displayed. Video is updated to reflect the new data. Checksum and Byte counter are updated with new data. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 72 @TAPERD --------- Read Tape entry point. @TAPEVER --------- Verify Tape entry point. @TAPEWRT --------- Write Tape entry point. @PUTSYNC --------- Turns on tape deck, and writes leader and sync byte. @KIMBOOT --------- Boot written for Mod I to boot TRSDOS @KIMBOOT3 Boot written for Mod III to boot TRSDOS NOTE: The above 2 boots are used in the 'repair boot sector' in the disk repair utilities. A duplicate of these boots are located on the 'hard configuration' sectors. @PGMEND --------- Last byte in the program plus one. This represents the first available byte for buffer use. @PRBUFF --------- 1024 byte buffer used for printer spooler I/O. NOTE: When a call is made to @POUT to send a byte to the printer it is actually saved in this buffer. The interrupt service (@TASK) will take a byte out of this FIFO buffer and send it to the printer. This limits the speed of the printer to 40 cps (25 ms interrupts), and slows down a fast printer, but it does free up the CPU to perform other tasks instead of dedicated printing. @DAMBUFF --------- Data Address Mark buffer. When several sectors are read into memory, such as via a call to @MREAD, the data address marks for each sector are saved contiguously in this buffer so that when they are written back out to disk they will be marked correctly. @GATBUFF --------- Normal buffer area used to read in a directory. The number of sectors in the directory can be fetched Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 73 from @DIRCOUNT. @BUFFER --------- A buffer starting 256 bytes past @GATBUFF. This buffer points at a HIT table in memory. @FBUFF --------- Normally used as the starting address of a format buffer. When a disk is formatted, every byte is prepared ahead of time starting at this address, and is written to a disk with a write track command. This address is high enough so that a full track of sectors can be held below it. This is how the format without erase works. It first reads all sectors on a track starting at @GATBUFF, and the data address marks are stored at @DAMBUFF. The track is prepared starting at @FBUFF, and written to disk. Then the tracks data starting at @GATBUFF is written back to the track a sector at a time. @ENTRY --------- The normal entry point to the initialization code of SU+. This address is PAST the program end, and all the memory used by the initialization code is reclaimed as buffer area after the code is run one time. This will set up the interrupt service, print the program labels, and read the configuration data from the disk. Once the program is running, 2 alternate entry points are available. 4015H branches back to the Master Menu. 4018H branches back to the last sub-menu viewed. NOTE: The ONLY memory NEVER used by SU+ is from @PGMEND to @PRBUFF-1. This represents the uneven block of memory from the last byte of the program to the next even page of memory. If the user desires, @TOPMEM may be reduced by even pages of memory if more is needed. Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 74 ***** SAMPLE ROUTINES ***** ; compute the number of free directory records on a disk START RST 8 ;display message DB 7 ;clear screen DB '** Computing Number of Directory Records **' DB 10 ;linefeed DB 0 ;string terminator CALL @ONEDRIVE ;ask for a single drive CALL @RDDIR ;read the directory JP Z,@NOTDIR ;not a directory JP C,@NOTDIR ;can't locate it CALL @GETENTRY ;load DE with # of directory records CALL @INITCNT ;clear the counter LD HL,@GATBUFF+200H ;start of files LOOP BIT 4,(HL) ;active record? CALL Z,@ADDCNT ;bump counter if available CALL @HLDIR ;bump HL to next file area DEC DE ;decrement file counter LD A,D OR E ;any more left? JR NZ,LOOP ;do 'em all CALL @SHOCNT ;display the counter CALL @DRVASC ;get ascii drive number LD (DRVE),A ;insert into message RST 8 ;and print this message DB 'Free Files on Drive ' DRVE DB 'x.',10,0 ;finish message JP @GOBACK ;press to continue ; read a directory into memory, then display it by sector START CALL @ONEDRIVE ;ask for drive CALL @RDDIR ;read the directory JP C,@NOTDIR ;not a directory JP Z,@NOTDIR LD HL,@GATBUFF ;where data begins JP @DOADDR ;display it in memory ; verify all sectors on a diskette START CALL @ONEDRIVE ;ask for a drive CALL @INITCNT ;zero the counter LD DE,0 ;starting sector on disk OR A ;clear carry CALL @GETTYPEA ;get drive type BIT 2,A ;check for TRSDOS III JR Z,BEGIN ;go if not INC E ;no sector 0 on TRS III Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 75 BEGIN LD BC,@BUFFER ;where to read data RST 28H ;display track/sector and read it CALL @NEXSEC ;bump to next sector JR NC,BEGIN ;C = end of disk CALL @SHOCNT ;display error counter RST 8 ;message DB 'Bad Sectors on the disk.',10,0 JP @GOBACK ;terminate here ; zero a single sector on a disk START CALL @GETDAT ;ask for drive, track, sector LD BC,@BUFFER ;point to buffer area CALL @ZBUFF ;zero the buffer AGAIN RST 30H ;write to disk JP Z,@GOBACK ;successful JR AGAIN ;write again if 'retry' selected ; check to see if a file exists on a disk START CALL @ASKFILE ;fetch filename CALL @MOVEFILE ;move to DCB CALL C,@BADFILE ;bad filename JR C,START ;ask again CALL @FINDFILE ;locate file CALL C,@NOFILE ;file not found JR C,START ;ask again CALL @DRVASC ;get drive where found LD (MSG),A ;put into message RST 8 ;display message DB 'File Found on Drive ' MSG DB 'x.',10,0 JR START ;ask for another ; log TRSDOS III system files into a directory START CALL @ONEDRIVE ;ask for drive number CALL @RDDIR ;read the directory JP Z,@NOTDIR ;non disk error, invalid format JP C,@NOTDIR ;disk error occured OR A ;clear carry flag CALL @GETTYPEA ;get dos type from table BIT 2,A ;check for TRSIII JR NZ,OKGO ;ok if SET RST 8 ;else print message DB 'Not a TRSDOS III diskette.',10,0 JR START ;ask again Copyright (c) 1982 Breeze/QSD, Inc. Super Utility Tech Manual Page 76 OKGO CALL @DIRPART ;display name/date, free grans LD IY,@GATBUFF+1E0H ;where sys files start LD C,0 ;current system number LD B,16 ;16 system files possible LOOPA LD A,(IY) ;get a byte INC A ;FF = inactive JR Z,DEAD ;this one not active CALL @FINDSPOT ;locate an available space PUSH HL ;pass to IX POP IX ;IX = start of record LD (IX),10H ;set as active, non-system, visible CALL PUTNAME ;insert name into the entry LD A,(IY+1) ;get start track of data LD (IX+22),A ;insert into file entry LD A,(IY) ;get start sector, # of grans LD (IX+23),A ;put into file entry AND 1FH ;get number of grans LD E,A ;save it ADD A,A ;A time 2 ADD A,E ;A times 3 (3 sectors per gran) LD (IX+20),A ;put end of file sector LD (IX+16),0EFH ;insert null passwords LD (IX+17),5CH ;EF5CH = null password TRSIII LD (IX+18),0EFH LD (IX+19),5CH LD (IX+24),0FFH ;insert extent terminator DEAD INC IY ;point to next one INC IY ;2 bytes per entry INC C ;bump system number counter DJNZ LOOPA ;finish them all CALL @MAKEHIT ;insert names in HIT table JP @WRDIR ;write directory back to the disk PUTNAME LD (IX+5),'S' ;insert filename LD (IX+6),'Y' LD (IX+7),'S' LD (IX+8),'T' LD (IX+9),'E' LD (IX+10),'M' LD A,C ;get system number PUSH BC ;must save counter RST 18H ;convert to ascii LD (IX+11),C ;put into filename LD (IX+12),B POP BC ;can restore it now LD (IX+13),'S' LD (IX+14),'Y' LD (IX+15),'S' RET ;name now in the right place Copyright (c) 1982 Breeze/QSD, Inc.