This the multi-page printable view of this section.Click here to print.
Function | Address | Description |
---|---|---|
DOS_GET_POSITION | 0133 | Get the file pointer |
Returns the current position in the file
Register | Content |
---|---|
B | File number 0…15 |
Function | Address | Description |
---|---|---|
DOS_SET_POSITION | 0136 | Set the file pointer |
Sets the file pointer. This does not access the disk, nor does it check if the file pointer is >= 8 megabytes.
Register | Content |
---|---|
B | File number 0…15 |
E HL |
File pointer 0x000000…0xFFFFFF (16Mb) E is most significant byte, L least |
Function | Address | Description |
---|---|---|
DOS_GET_EOF | 0139 | Get the end of file (EOF) position |
Get the end of file (EOF) file position greater than all written byte positions. Does not affect the file pointer. Does not consider soft-EOF.
Register | Content |
---|---|
B | File number 0…15 |
Function | Address | Description |
---|---|---|
DOS_GET_1346 | 013C | Set current cache/ramdisk location |
Get the current location of the cache and RAMdisk.
Pages 1, 3, 4, 6 are considered as an array of 128 sector buffers (numbered 0...127), each of 512 bytes. The cache and RAMdisk occupy two separate (contiguous) areas of this array.
Any unused sector buffers may be used by the caller.
Note that the sizes may be smaller than those specified in DOS_SET_1346, as there is an (unpublished) maximum size of cache and a minimum size of RAMdisk (4 sectors).
None
Function | Address | Description |
---|---|---|
DOS_SET_1346 | 013F | Rebuild the sector cache and RAM disk |
Rebuild the sector cache and RAM disk.
This routine is used to make some store available to the user, or to return store to DOS. Note that if the RAM disk is moved, or its size is changed, then all files thereon are erased.
Pages 1, 3, 4, 6 are considered as an array of 128 sector buffers (numbered 0...127), each of 512 bytes. The cache and RAMdisk occupy two separate (contiguous) areas of this array.
The location and size of the cache and RAMdisk can be specified separately; any remaining buffers are unused by DOS and are available to the caller.
Note that the sizes actually used may be smaller than those specified as in practice, there is a maximum cache size and a minimum size of RAMdisk (4 sectors).
A cache size of 0 will still work but will seriously impair the floppy disk performance.
This routine will fail if there are any files open on drive M:
Register | Content |
---|---|
D | First buffer for cache |
E | Number of cache sector buffers |
H | First buffer for RAM disk |
L | Number of RAM disk sector buffers |
Note: E + L <= 128 |
Function | Address | Description |
---|---|---|
DOS_FLUSH | 0142 | Write any pending data to this drive |
Write any pending headers, data, directory entries for this drive.
This routine ensures that the disk is up-to-date. It can be called at any time, even when files are open.
Register | Content |
---|---|
A | Drive A…P |
Function | Address | Description |
---|---|---|
DOS_SET_ACCESS | 0145 | Change access mode of an open file |
Try to change the access mode of an open file.
This routine will fail if the file is already open, in an incompatible access mode, or if write access is required for a read-only file or disk.
Register | Content |
---|---|
B | File number 0…15 |
C |
Access mode required: Bits 0…2: 1 = exclusive read 2 = exclusive write 3 = exclusive read/write 5 = shared read Bits 3…7 =0 as reserved |
Function | Address | Description |
---|---|---|
DOS_SET_ATTRIBUTES | 0148 | Set a files attributes |
Set a file's attributes.
Only the file attributes f1'...f4', t1'...t3' can be set or cleared. The interface attributes f5'...f8' are always 0.
This routine first sets the attributes specified in D, then clears those attributes specified in E, i.e. E has priority.
Register | Content |
---|---|
D | Attributes to set |
E | Attributes to clear |
HL | Address of filename, wildcards permitted |
Bit | Attribute | Bit | Attribute | |
---|---|---|---|---|
0 | t3 | Archive | 3 | f4 |
1 | t2 | System | 4 | f3 |
2 | t1 | Read Only | 5 | f2 |
6 | f1 |
Function | Address | Description |
---|---|---|
DOS_OPEN_DRIVE | 014B | Open drive as a single file |
Open the disk in this drive as a single file.
The whole disk is presented as a single file regardless of any real files on the disk. This routine can be used to examine/poke directories, files, etc. It should not be used by the uninitiated, the faint-hearted, or by anyone who values their files!
Sets file pointer to 0x000000 (0).
If there are any files open on this drive from other file numbers with shared-read access, then the disk can only be opened with shared-read access from this file number.
If there are any file open on this drive from other file numbers with exclusive access, then the disk cannot be opened from this file number.
Register | Content |
---|---|
A | Drive A…P |
B | File number 0…15 |
C |
Access mode required: Bits 0…2: 1 = exclusive read 2 = exclusive write 3 = exclusive read/write 5 = shared read All other bits are reserved |
Function | Address | Description |
---|---|---|
DOS_SET_MESSAGE | 014E | Enable/disable disk error messages |
Enable/disable disk error messages.
This should be used to make +3DOS aware of your own ALERT subroutine. When +3DOS detects an error, it will call your ALERT subroutine, passing to it the values documented below. The ALERT subroutine should print the text of the message that +3DOS passes it, then should wait for the user to press a key. If the key is in the reply string (that +3DOS also passes - version V1.0 only), then a 'ret' should be made with A = 0, 1 or 2, or containing the character (depending on the version of +3DOS).
Register | Content |
---|---|
A | Enable 0xff or disable 0x00 |
HL | Address of ALERT routine if enabled |
Note that if you are substituting your own ALERT subroutine, the 'entry conditions' are the conditions passed to your subroutine and the 'exit conditions' are the values that your subroutine must produce and the registers you are allowed to corrupt.
There are two routine interfaces for ALERT, depending on which version of +3DOS is installed.
If you provide an ALERT function, you should have two subroutines, or one with switchable entry and exit conditions, and check the +3DOS version number before deciding which one to use.
Register | Content |
---|---|
DE | Address of reply string in page 7 terminated by 0xFF |
HL | Address of error message in page 7 terminated by 0xFF |
The second version allows the user to provide non-UK error messages and is generally more flexible, is present in +3DOS versions V1.1 and upwards.
Register | Content |
---|---|
B | Error number |
C | Drive A…P |
D | Logical track if required by message |
E | Logical sector if required by message |
HL | Address of UK error message in page 7 terminated by 0xFF |
Function | Address | Description |
---|---|---|
DOS_REF_XDPB | 0151 | Point at XDPB for this drive |
Point at the XDPB for this drive. (The XDPB is required by the floppy disk driver routines.)
Register | Content |
---|---|
A | Drive letter A…P |
Function | Address | Description |
---|---|---|
DOS_MAP_A | 0154 | Map drive B to unit 0 or 1 |
Map drive B: to unit 0 or unit 1. This routine will fail if drive B: has files open.
If mapping B: to unit 0, then each time unit 0 is accessed, a check is made that the drive mapping is correct. If it isn't, then a reverse call to CHANGE DISK is made, to ask the user to change the disk in unit 0.
If mapping B: to unit 1, then if unit 1 does not exist, drive B: is disabled.
Register | Content |
---|---|
C | Unit 0 or 1 |
HL | Address of change disk routine if unit = 0 |
If you are substituting your own CHANGE DISK subroutine, the 'entry conditions' are the conditions passed to your subroutine, and the 'exit conditions' are registers you are allowed to corrupt.
Register | Content |
---|---|
A | Logical drive A…P |
HL | Address of message in page 7 terminated by 0xFF |