AtomLite+ B-DOS ver. 1.5a Specific Hook Codes Description All codes in brackets [] in this list are ignored by B-DOS (just a RETurn from DOS). The hook codes followed with a 'B' are B-DOS speciffic. A 'M' indicates compatibility with Masterdos. Other hookcodes are compatible with both SAMDOS and Masterdos. 128 &80 INIT Same as HAUTO. 129 &81 HGTHD Get file header. 130 &82 HLOAD Load data from from file which is selected with HGTHD. 131 &83 HVERY Verify data from from file which is selected with HGTHD. 132 &84 HSAVE Save file. 134 &86 B HVMSAD Verify multiple sectors. 135 &87 B HDINIT Re-initialize B-DOS 136 &88 HAUTO Loads "AUTO*" file. 139 &8B HVAR Expects the DVAR number on the calculator stack. 147 &93 HOFLE Open a new file. 148 &94 HSBYT Save Byte in the A register to the file opened with HOFLE. 149 &95 HWSAD Write a single sector. 150 &96 HSVBK Save a Block to file opened with HOFLE. 152 &98 HCFSM Close file sector map. 156 &9C B HRECORD Select a record. 157 &9D B HVEBK Verifies a block. 158 &9E HGFLE Get file. 159 &9F B HLBYT Load byte from file. 160 &A0 HRSAD Read sector 161 &A1 HLDBK Load a block from file. 162 &A2 M HMRSAD Read Multiple sectors 163 &A3 M HMWSAD Write multiple sectors 164 &A4 HREST Restores last used drive head to track 0 165 &A5 HDIR Clears the screen and outputs a directory to screen. 166 &A6 HERAZ Erase file. [ SAMDOS: When the hook code explanation refers to 'RPT', it refers to the pointer used internally by SAMDOS. 128 &80 INIT Same as HAUTO [ SAMDOS: This routine looks for an AUTO file on the current disk, and initialises the DVARS. ] [ MasterDOS: Look for an AUTO file on the current disk. No action (or error) occurs if there is no AUTO file, otherwise it is loaded (and executed if it is an auto-running Basic or CODE file). This Hook can only be used in sections B and C of the memory map. ] 129 &81 HGTHD Get file header. IX points to a tape like header (file name at IX+1 to IX+14). file name may include "D1:" or "D2:" The loaded header can be found at &4B50 in the system page. [ SAMDOS: Get file header. This routine should be called with IX pointing to the UIFA, which should contain the file type and filename required. When completed the complete file header will be transferred in UIFA form to IX+80 bytes. ] [ MasterDOS: Get file header. This routine should be called with IX pointing to the UIFA, which should hold the file type required (at IX+0) and the file name (at IX+1 to IX+10). The routine looks for the file in the current directory on the current drive and either returns with an error code, or transfers the data from the file directory to IX+80, in UIFA form. The calling code and the UIFA can be in sections B, C or D of the memory map. (Note: this hook works correctly in SAMDOS, provided that IX=&4B00.)] 130 &82 HLOAD Load data from from file which is selected with HGTHD. Destination page paged at location C Destination offset (32768 - 49151) C =length in 16K pages (0 - 31) DE =Modulo length (0 - 16383) [ SAMDOS: Load file in UIFA pointed to by IX register. The C register contains the number of 16K pages used by the file, while DE must contain the length modulo 16K. The HL register pair must point to a destination between 8000H to BFFFH, while the destination page must be paged in using the HMPR register. These values can be obtained from the header loaded by HGTHD. ] 131 &83 HVERY Verify data from from file which is selected with HGTHD. Destination page paged at location C Destination offset (32768 - 49151) C =length in 16K pages (0 - 31) DE =Modulo length (0 - 16383) [ SAMDOS: Verify the memory to the file stored on the disk. Again the IX register must be a pointer to the file UIFA. Use as HLOAD, but verifies rather than loads. ] [ MasterDOS: Like HLOAD, but verify the data on the disk against the data in memory. Error code 93 returned if verify failed. ] 132 &84 HSAVE Save file. IX should point to a 48 bytes header containing type, name and file specific information. [ SAMDOS: Save the file whose UIFA is pointed to by the IX register. The UIFA must be a complete UIFA, including file length, etc. ] [ MasterDOS: Save the file whose UIFA is pointed to by IX. All relevant data in the UIFA must be complete - for a CODE file, type, name, start, length and execute address. If in doubt, try a SAVE from BASIC and then look at &4B00-&4B47 to find the required values. ] [ MasterDOS: HSKSF 133 (&85) Seek Safe. On some machines, pressing the Reset button can corrupt the disk sector under the drive head. This is often on the track containing the last sector of the last file loaded. MasterDOS tries to minimise the problem by parking the drive head on the last track in the directory, after a LOAD or a SAVE. This track will be unused unless the directory is fairly full. Using the HSKSF hook will move the head of the current drive to the last track in the directory, unless this would be track 4 (which contains the first sector of DOS) in which case track 3 is used instead. ] 134 &86 B HVMSAD Verify multiple sectors A = drive number D = track, E=sector C = memory page HL = memory offset (32768 to 49151) IX = number of sectors Multiple sectors only works with 512 bytes sectors. 135 &87 B HDINIT Re-initialize B-DOS,prints BDOS logo re-inits clock,hard disk and DVARS. 136 &88 HAUTO Loads "AUTO*" file. This file can be BASIC or CODE type. [ MasterDOS: Like Hook 128, but an error code of 101 is returned if there is no AUTO file. ] [ MasterDOS: HSKTD 137 (&89) Seek Track D. Move the drive head of the current drive to the track specified in the D register. ] [ MasterDOS: HFMTK 138 (&8A) Format Track. Format the track under the drive head, using the D register to supply the track number and the E register as the number of the first sector (1-10). Later sectors will be numbered 1 higher until 10 is reached and numbering goes back to 1. ] 139 &8B HVAR Expects the DVAR number on the calculator stack. Restacks the basic address of the required DVAR. If dvar 39 is addressed the clock DVARS are updated. B-DOS also puts the DVAR offset in the 1st two bytes of the DOS page.(See DVARS) [ SAMDOS: This routine calls the jump table thus unstacking the number following the DVAR into BC. The routine then supplies the address of the DVAR by putting it onto the BASIC floating point calculator stack. ] [ MasterDOS: Supply the address of a DVAR by putting it on the floating point calculator stack. On entry, the FPCS should hold the desired DVAR number. Note: it is probably easier to page in DOS (the DOS page is held at &5BC2) and read the disk variables directly. DVAR 0 is at an offset of &0220 within the page - this will not change. ] [ MasterDOS: HEOF 140 (&8C) Supply the End-Of-File status (1 or 0) of a specified stream. The stream number should be on the FPCS. It will be replaced by the EOF status. ] [ MasterDOS: HPTR 141 (&8D) Supply the PTR value for a specified stream. The stream number on the FPCS is replaced by the PTR value. ] [ MasterDOS: HPATH 142 (&8E) Supply the current PATH$ on the FPCS. Use CALL &0124 (JSTKFETCH) to get page (A) offset (DE) and length (BC) of the string. ] [ MasterDOS: HLDPG 143 (&8F) As Hook 130, but on entry the A register should hold the page number of the destination address. This need not be paged in. ] [ MasterDOS: HVEPG 144 (&90) As Hook 131, but on entry the A register holds the page to verify against. ] [ MasterDOS: HSDIR 145 (&91) Select Directory. Similar to DIR="name" in Basic. On entry, the registers hold details of the location and length of the desired subdirectory name. DE is the offset, A is the page of the name start, and BC is the name length. ] [ MasterDOS: HSDIR 145 HOFSM 146 (&92) Open a File Sector Map for an OPENTYPE file. IX must point to the UIFA. The routine will create the map and clear the disk buffer. ] 147 &93 HOFLE Open a new file. IX points to a 48 byte header and 9 header bytes are saved to the file. Before using this hook poke &5BB9 with 0 to overite existing file. [ SAMDOS: Open a file on the disk. IX must point to the UIFA. The routine will create a sector address map, and save the header to the disk and reset pointer RPT. ] [ MasterDOS: Open a file on the disk. IX must point to the UIFA. The routine will create a sector address map, and save a 9-byte header to the disk buffer. ] 148 &94 HSBYT Save Byte in the A register to the file opened with HOFLE. [ SAMDOS: Save the byte in the Accumulator to the RAM pointed to by the pointer RPT. If the sector is full the data will be stored in the next sector pointed to by the sector address map. ] [ MasterDOS: Save the byte in the A register to the disk file (If the buffer is full it will be written to the disk and the byte will go into the start of the next buffer). ] 149 &95 HWSAD Write a single sector. A=drive number D = track, E=sector HL =memory address (16384 to 65024) [ SAMDOS: D contains the track number, and E contains the sector number. The Accumulator holds the drive number (1 or 2). Writes the sector pointed to by the DE register pair. The Accumulator contains the drive number, while the HL register pair is the pointer to the source data which must be resident in the 64K address map. ] [ MasterDOS: Write Single Sector. On entry, the A register is the drive number (1-7) which is used to access the table at DVAR 111 to get the actual drive to use. D holds the destination track, and E the sector number. HL points to the source in memory, which must be in sections B, C or D of the memory map. 512 bytes will be written to disk. ] 150 &96 HSVBK Save a Block to file opened with HOFLE. saves A pages and DE bytes from page selected in location C starting at HL. Hl points also to location C in memory. Note that this hookcode must be used only in location B (&4000 to &7FFF). [ SAMDOS: Save a block of data to the disk where the DE register pair points to -the start of the data, and the BC register pair holds the byte count. ] [ MasterDOS: Save a block of data to the disk file. The A register holds the length to save in pages, and DE holds the length MOD 16K. HL points to the start of the data to save, paged into section C of the memory map. ] [ MasterDOS: HDBOP 151 (&97) Save BC bytes to the disk file. DE points to the start of the data to save, paged into section C of the memory map. Used by DOS to write strings to OPENTYPE files. ] 152 &98 HCFSM Close file sector map. Closes the file opened with HOFLE and the file is made in the directory. [ SAMDOS: Close file sector map. This routine empties the RAM and copies the header area on to the directory, closes the file, then updates the directory. ] [ MasterDOS: Close a file. This routine writes the last buffer to a disk file and creates a directory entry for it. IX should point to the UIFA. ] [ MasterDOS: HORDER 153 (&99) Sort list into ASCII order. HL should point to the start of the list in sections B, C or D of the memory map. The BC register should hold the length of each item in the list, and the DE register the number of items. The A register specifies the number of characters to sort on. No paging is performed so the entire list must be paged in by the user before this hook is called. ] [ MasterDOS: HRSAD 155 (&A0) Read Single Sector. On entry, the A register is the drive number (1-7) which is used to access the table at DVAR 111 to get the actual drive to use. D holds the source track, and E the sector. HL poitns to the destination in memory, which must be in sections B, C or D of the memory map. 512 bytes will be read from the disk. ] 156 &9C B HRECORD Select a record. If A = 0 then select record number HL. Else select record by. name. HL points to the 16 char. name. 157 &9D B HVEBK Verifies a block. See HSVBK for more details. 158 &9E HGFLE Get file. [ SAMDOS: Get a file from the disk. The IX register must point to the UIFA. The return is made with the first sector of the file loaded into RAM and RPT pointing to the first byte. ] [ MasterDOS: Get a file from the disk. The IX register must point to the UIFA. The return is made with the first sector of the file loaded into the disk buffer and RPT pointing to the first byte. ] 159 &9F B HLBYT Load byte in D register from file. [ SAMDOS: Load the byte pointed to by RPT from RAM, place it in the Accumulator, and increment the RPT. When the sector has all been read then the next sector is loaded from the disk and the pointer adjusted. ] 160 &A0 HRSAD Read sector A=drive number D = track, E=sector HL =memory address (16384 to 65024) [ SAMDOS: HRSAD D contains the track number and E contains the sector number. The Accumulator holds the drive number (1 or 2).Reads the sector pointed to by the DE register pair. The Accumulator contains the drive number, while the HL register pair is the pointer to the destination. ] 161 &A1 HLDBK Load a block from file. See HSVBK for more details. [ SAMDOS: Load a block of data from the disk to the memory pointed to by DE with the block count in BC. ] [ MasterDOS: Load a block of data from the current disk file. HL points to the destination of the data in memory, paged into section C of the memory map. The A register is the length to load, in pages, and DE holds the length MOD 16K. ] 162 &A2 M HMRSAD Read Multiple sectors A = drive number D = track, E=sector C = memory page HL = memory offset (32768 to 49151) IX = number of sectors Multiple sectors only works with 512 bytes sectors. [ MasterDOS: Read Multiple Sectors. Equivalent to READ AT in Basic. The A register is the drive to user (1-7 using DVAR 111 table), D holds the track, E the sector, C the page and HL the offset (&8000- &BFFF) of the destination. IX holds the number of sectors to load. ] 163 &A3 M HMWSAD Write multiple sectors A = drive number D = track, E=sector C = memory page HL = memory offset (32768 to 49151) IX = number of sectors Multiple sectors only works with 512 bytes sectors. [ MasterDOS: Write Multiple Sectors. Equivalent to WRITE AT in Basic. As above, but C and HL hold the source address, rather than the destination. ] 164 &A4 HREST Restores last used drive head to track 0 ignored by hard disk [ SAMDOS: Restore disk drive to track 0. The Accumulator holds the drive number , ie, 1 or 2. ] [ MasterDOS: Restore. Move drive head to track 0. The disk need not be formatted. ] 165 &A5 HDIR Clears the screen and outputs a directory to screen. A register: =2 short dir,= 4 detailed dir [ SAMDOS: Perform a directory listing to current stream. ] [ MasterDOS: Print directory. If the A register holds 2, print a simple directory. If it holds 4, print a detailed directory. Neither option does a CLS first. The current stream is used to output. ] 166 &A6 HERAZ Erase file which name is at IX+1 to IX+10 [ SAMDOS: Erase a file from the disk. Register IX must point to the UIFA of the file to be erased. [ MasterDOS: ERASE a file from disk. The file name should be at IX+1 to IX+10.]