| void DOS_Call( |
| ) |
Call a BDOS function
Exit program and return to DOS When this is called in MSX-DOS, the system is reset by jumping to 0000H. When MSX DISK-BASIC call this, it is “warm started”. That is, it returns to BASIC command level without destroying programs currently loaded. With MSX-DOS 2, this function terminates program with a zero return code.
Input character A character will be read from the standard input (file handle 0 - usually the keyboard) and echoed to the standard output (file handle 1 - usually the screen). If no character is ready then this function will wait for one. Various control characters, as specified for the "console status" function (function 0Bh), will be trapped by this function for various control purposes. If one of these characters is detected then it will be processed and this function will wait for another character. Thus these characters will never be returned to the user by this function.
Character from keyboard
| void DOS_CharOutput( |
| ) |
Output character The character passed in register E is written to the standard output (file handle 1 - usually the screen). If printer echo is enabled then the character is also written to the printer. Various control codes and escape sequences are interpreted as screen control codes. A list of these is included in the "Program Interface Specification", they are a sub-set of the standard VT-52 control codes. TABs will be expanded to every eighth column.
| chr c8 | Character to be output |
| void DOS_StringOutput( |
| ) |
The characters of the string will be output. The string is terminated by "$" (ASCII 24h).
| str const c8* | Address of string |
Play bip sound
Clear console screen
Carriage return
| void DOS_SetTransferAddr( |
| ) |
Set transfer address This function simply records the address passed in DE as the disk transfer address. This address will be used for all subsequent FCB read and write calls, for "search for first" and "search for next" calls to store the directory entry, and for absolute read and write calls. It is not used by the new MSX-DOS read and write functions. The address is set back to 80h by a DISK RESET call.
| data void* | Required Disk Transfer Address |
| u8 DOS_OpenFCB( |
| ) |
Open file The unopened FCB must contain a drive which may be zero to indicate the current drive and a filename and extension which may be ambiguous. The current directory of the specified drive will be searched for a matching file and if found it will be opened. Matching entries which are sub-directories or system files will be ignored, and if the filename is ambiguous then the first suitable matching entry will be opened.
| stream DOS_FCB* | Pointer to unopened FCB |
Error code (DOS_ERR_NONE if succeed)
| inline u32 DOS_GetSizeFCB( |
| ) |
Get the size of an opened file
| stream DOS_FCB* | Pointer to unopened FCB |
File size
| u8 DOS_CloseFCB( |
| ) |
Close file
| stream DOS_FCB* | Pointer to unopened FCB |
Error code (DOS_ERR_NONE if succeed)
Error code (DOS_ERR_NONE if succeed)
| u8 DOS_CreateFCB( |
| ) |
Create file
| stream DOS_FCB* | Pointer to unopened FCB |
Error code (DOS_ERR_NONE if succeed)
| u8 DOS_SequentialReadFCB( |
| ) |
Sequential read
| stream DOS_FCB* | Pointer to unopened FCB |
Error code (DOS_ERR_NONE if succeed)
| u8 DOS_SequentialWriteFCB( |
| ) |
Sequential write
| stream DOS_FCB* | Pointer to unopened FCB |
Error code (DOS_ERR_NONE if succeed)
| u8 DOS_RandomBlockWriteFCB( |
| ) |
Random block write
| stream DOS_FCB* | Pointer to unopened FCB |
| records u16 | Number of records to write |
Error code (DOS_ERR_NONE if succeed)
| u16 DOS_RandomBlockReadFCB( |
| ) |
Random block read
| stream DOS_FCB* | Pointer to unopened FCB |
| records u16 | Number of records to write |
Number of records actually read
| u8 DOS_FindFirstFileFCB( |
| ) |
Search the first file matched with wildcard
| stream DOS_FCB* | Pointer to unopened FCB |
Error code (DOS_ERR_NONE if succeed)
Search the second and after the second file matched wildcard
Error code (DOS_ERR_NONE if succeed)
| u8 DOS_OpenHandle( |
| ) |
Open file handle
| path const c8* | Drive/path/file ASCIIZ string |
| mode u8 | Open mode |
O_RDONLY Open file for reading only
O_WRONLY Open file for writing only
O_RDWR Open file for reading and writing
O_INHERIT
New file handle
| u8 DOS_CreateHandle( |
| ) |
Create file handle
| path const c8* | Drive/path/file ASCIIZ string |
| mode u8 | Open mode |
O_RDONLY Open file for reading only
O_WRONLY Open file for writing only
O_RDWR Open file for reading and writing
O_INHERIT
attr - Required attributes
New file handle
| u8 DOS_CloseHandle( |
| ) |
Close file handle
| file u8 | File handle |
Error code
| u8 DOS_EnsureHandle( |
| ) |
Ensure file handle
| file u8 | File handle |
Error code
| u8 DOS_DuplicateHandle( |
| ) |
Duplicate file handle
| file u8 | File handle |
Error code
| u16 DOS_ReadHandle( |
| ) |
Read from file handle
| file u8 | File handle |
| buffer void* | Buffer address |
| size u16 | Number of bytes to read |
Number of bytes actually read
| u16 DOS_WriteHandle( |
| ) |
Write to file handle
| file u8 | File handle |
| buffer const void* | Buffer address |
| size u16 | Number of bytes to read |
Number of bytes actually written
| u32 DOS_SeekHandle( |
| ) __CALLEE |
Move file handle pointer
| file u8 | File handle |
| offset i32 | Signed offset |
| mode u8 | Method code |
SEEK_SET Relative to the beginning of the file
SEEK_CUR Relative to the current position
SEEK_END Relative to the end of the file
New file pointer
| u8 DOS_DeleteHandle( |
| ) |
Delete file or subdirectory
| file u8 | File handle |
Error code
| u8 DOS_RenameHandle( |
| ) |
Rename file or subdirectory
| file u8 | File handle |
Error code
| u8 DOS_MoveHandle( |
| ) |
Move the file associated with the specified file handle to the directory specified by the new path string. A file handle cannot be moved if there are any other separately opened file handles for this file (".FOPEN" error), although it can be moved if there are copies of this file handle, and in this case the copies will also be moved. Moving a file handle will not alter the file pointer but it will do an implicit "ensure" operation.
| file u8 | File handle |
Error code
| u8 DOS_SetAttributeHandle( |
| ) |
Set the attributes byte of the file associated with the specified file handle. A file handle cannot have its attributes changed (although they can be read) if there are any other separately opened file handles for this file (".FOPEN" error). The file pointer will not be altered but an implicit "ensure" operation will be done.
| file u8 | File handle |
Error code
| u8 DOS_GetAttributeHandle( |
| ) |
Get the attributes byte of the file associated with the specified file handle. A file handle cannot have its attributes changed (although they can be read) if there are any other separately opened file handles for this file (".FOPEN" error). The file pointer will not be altered but an implicit "ensure" operation will be done.
| file u8 | File handle |
Error code
| u8 DOS_GetDiskParam( |
| ) |
Get disk parameters
| void DOS_Exit( |
| ) |
Terminate with error code
| void DOS_Explain( |
| ) |
Explain error code
Get last error code
| DOS_FIB* DOS_FindFirstEntry( |
| ) |
Find first entry
Find next entry
Get last file info
| inline u16 DOS_GetFileYear( |
| ) |
Get last error code
| fib const DOS_FIB* | Pointer to File Info Block structure |
Year (from 1980)
| inline u8 DOS_GetFileMonth( |
| ) |
Get last error code
| fib const DOS_FIB* | Pointer to File Info Block structure |
Month number
| inline u8 DOS_GetFileDay( |
| ) |
Get last error code
| fib const DOS_FIB* | Pointer to File Info Block structure |
Day number
| inline u8 DOS_GetFileHour( |
| ) |
Get last error code
| fib const DOS_FIB* | Pointer to File Info Block structure |
Hours
| inline u8 DOS_GetFileMinute( |
| ) |
Get last error code
| fib const DOS_FIB* | Pointer to File Info Block structure |
Minutes
| inline u8 DOS_GetFileSecond( |
| ) |
Get last error code
| fib const DOS_FIB* | Pointer to File Info Block structure |
Seconds
| u8 DOS_Delete( |
| ) |
Delete file or subdirectory
| path const c8* | Drive/path/file ASCIIZ string or fileinfo block pointer |
Error code
| u8 DOS_Rename( |
| ) |
Rename file or subdirectory
| path const c8* | Drive/path/file ASCIIZ string or fileinfo block pointer |
| newPath const c8* | New filename ASCIIZ string |
Error code
| u8 DOS_Move( |
| ) |
Move file or subdirectory
| path const c8* | Drive/path/file ASCIIZ string or fileinfo block pointer |
| newPath const c8* | New filename ASCIIZ string |
Error code
| u8 DOS_SetAttribute( |
| ) |
Set file attributes
| path const c8* | Drive/path/file ASCIIZ string or fileinfo block pointer |
| attr u8 | New attributes byte |
Error code
| u8 DOS_GetAttribute( |
| ) |
Get file attributes
| path const c8* | Drive/path/file ASCIIZ string or fileinfo block pointer |
Error code
| u8 DOS_GetDirectory( |
| ) |
Get current directory
| drive u8 | Drive number |
| path const c8* | Pointer to 64 byte buffer (Filled in with current path after call) |
Error code
| inline u8 DOS_GetCurrentDiskDirectory( |
| ) |
Get directory in the current drive
| path const c8* | Pointer to 64 byte buffer (Filled in with current path after call) |
Error code
| u8 DOS_ChangeDirectory( |
| ) |
Change current directory
| path const c8* | Drive/path/file ASCIIZ string |
Error code
Get current date and time
| u8 DOS_GetVersion( |
| ) |
Get MSX-DOS version number