[41] | 1 | ; Project name : AssemblyLibrary
|
---|
| 2 | ; Description : Defines for MS-DOS functions.
|
---|
| 3 | %ifndef DOS_FUNCTIONS_INC
|
---|
| 4 | %define DOS_FUNCTIONS_INC
|
---|
| 5 |
|
---|
| 6 | ; DOS interrupts
|
---|
| 7 | DOS_INTERRUPT_21h EQU 21h
|
---|
[592] | 8 | DOS_CTRL_C_CTRL_BREAK_HANDLER_23h EQU 23h
|
---|
[41] | 9 | DOS_CRITICAL_ERROR_HANDLER_24h EQU 24h
|
---|
[85] | 10 | DOS_TSR_MULTIPLEX_INTERRUPT_2Fh EQU 2Fh
|
---|
[41] | 11 |
|
---|
[589] | 12 | ; DOS functions
|
---|
| 13 | WRITE_CHARACTER_TO_STANDARD_OUTPUT EQU 02h ; DOS 1+
|
---|
| 14 | WRITE_STRING_TO_STANDARD_OUTPUT EQU 09h ; DOS 1+
|
---|
| 15 | SELECT_DEFAULT_DRIVE EQU 0Eh ; DOS 1+
|
---|
| 16 | GET_CURRENT_DEFAULT_DRIVE EQU 19h ; DOS 1+
|
---|
| 17 | SET_INTERRUPT_VECTOR EQU 25h ; DOS 1+
|
---|
| 18 | GET_DISK_TRANSFER_AREA_ADDRESS EQU 2Fh ; DOS 2+
|
---|
| 19 | GET_DOS_VERSION EQU 30h ; DOS 2+
|
---|
| 20 | GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE EQU 32h ; DOS 2+
|
---|
| 21 | GET_INTERRUPT_VECTOR EQU 35h ; DOS 2+
|
---|
| 22 | SET_CURRENT_DIRECTORY EQU 3Bh ; DOS 2+
|
---|
| 23 | CREATE_OR_TRUNCATE_FILE EQU 3Ch ; DOS 2+
|
---|
| 24 | OPEN_EXISTING_FILE EQU 3Dh ; DOS 2+
|
---|
| 25 | CLOSE_FILE EQU 3Eh ; DOS 2+
|
---|
| 26 | READ_FROM_FILE_OR_DEVICE EQU 3Fh ; DOS 2+
|
---|
| 27 | WRITE_TO_FILE_OR_DEVICE EQU 40h ; DOS 2+
|
---|
| 28 | SET_CURRENT_FILE_POSITION EQU 42h ; DOS 2+
|
---|
| 29 | CHECK_IF_BLOCK_DEVICE_REMOTE EQU 4409h ; DOS 3.1+
|
---|
| 30 | GET_CURRENT_DIRECTORY EQU 47h ; DOS 2+
|
---|
| 31 | TERMINATE_WITH_RETURN_CODE EQU 4Ch ; DOS 2+
|
---|
| 32 | FIND_FIRST_MATCHING_FILE EQU 4Eh ; DOS 2+
|
---|
| 33 | FIND_NEXT_MATCHING_FILE EQU 4Fh ; DOS 2+
|
---|
[592] | 34 | GET_EXTENDED_ERROR_INFORMATION EQU 59h ; DOS 3.0+
|
---|
[41] | 35 |
|
---|
| 36 | ; DOS errors
|
---|
[589] | 37 | ERR_DOS_FUNCTION_NUMBER_INVALID EQU 01h
|
---|
[601] | 38 | ERR_DOS_PATH_NOT_FOUND EQU 03h
|
---|
[589] | 39 | ERR_DOS_INVALID_DRIVE EQU 0Fh
|
---|
[601] | 40 | ERR_DOS_NO_MORE_FILES EQU 12h
|
---|
[41] | 41 | ERR_DOS_DRIVE_NOT_READY EQU 15h
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 | ; DOS Program Segment Prefix (PSP, first 256 (100h) bytes on top of program)
|
---|
| 45 | struc PSP
|
---|
| 46 | .int20hInstruction resb 2
|
---|
| 47 | .wSizeOfMemoryInParagraphs resb 2
|
---|
| 48 | .reservedAt4h resb 1
|
---|
| 49 | .callToDosFunctionDispatcher resb 5
|
---|
| 50 | .fpInt22hTerminate resb 4
|
---|
| 51 | .fpInt23hCtrlC resb 4
|
---|
| 52 | .fpInt24hCriticalError resb 4
|
---|
| 53 | .reservedAt16h resb 22
|
---|
| 54 | .wEnvironmentSegment resb 2
|
---|
| 55 | .reservedAt2Eh resb 34
|
---|
| 56 | .int21hAndRetfInstructions resb 3
|
---|
| 57 | .reservedAt53h resb 9
|
---|
| 58 | .FCB1 resb 16
|
---|
| 59 | .FCB2 resb 20
|
---|
| 60 | .DiskTransferArea:
|
---|
| 61 | .bCommandLineLength resb 1
|
---|
| 62 | .szCommandLine resb 127
|
---|
| 63 | endstruc
|
---|
| 64 |
|
---|
| 65 |
|
---|
| 66 | ; DOS DTA (Disk Transfer Area)
|
---|
| 67 | struc DTA
|
---|
| 68 | ; Undocumented fields
|
---|
| 69 | .reservedAt0h resb 21
|
---|
| 70 | ; Documented fields
|
---|
| 71 | .bFileAttributes resb 1 ; 15h, Attribute of matching file
|
---|
| 72 | .wFileTime resb 2 ; 16h, File time
|
---|
| 73 | .wFileDate resb 2 ; 18h, File date
|
---|
| 74 | .dwFileSize resb 4 ; 1Ah, File size in bytes
|
---|
| 75 | .szFile resb 13 ; 1Eh, ASCIZ filename + extension
|
---|
| 76 | endstruc
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 | %endif ; DOS_FUNCTIONS_INC
|
---|