[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
|
---|
| 8 | DOS_CRITICAL_ERROR_HANDLER_24h EQU 24h
|
---|
[85] | 9 | DOS_TSR_MULTIPLEX_INTERRUPT_2Fh EQU 2Fh
|
---|
[41] | 10 |
|
---|
[85] | 11 | ; DOS drive and file functions
|
---|
[41] | 12 | SELECT_DEFAULT_DRIVE EQU 0Eh
|
---|
| 13 | GET_CURRENT_DEFAULT_DRIVE EQU 19h
|
---|
| 14 | GET_DISK_TRANSFER_AREA_ADDRESS EQU 2Fh
|
---|
| 15 | GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE EQU 32h
|
---|
| 16 | SET_CURRENT_DIRECTORY EQU 3Bh
|
---|
[446] | 17 | CREATE_OR_TRUNCATE_FILE EQU 3Ch
|
---|
[41] | 18 | OPEN_EXISTING_FILE EQU 3Dh
|
---|
| 19 | CLOSE_FILE EQU 3Eh
|
---|
| 20 | READ_FROM_FILE_OR_DEVICE EQU 3Fh
|
---|
| 21 | WRITE_TO_FILE_OR_DEVICE EQU 40h
|
---|
| 22 | SET_CURRENT_FILE_POSITION EQU 42h
|
---|
| 23 | GET_CURRENT_DIRECTORY EQU 47h
|
---|
| 24 | FIND_FIRST_MATCHING_FILE EQU 4Eh
|
---|
| 25 | FIND_NEXT_MATCHING_FILE EQU 4Fh
|
---|
| 26 |
|
---|
[85] | 27 | ; DOS functions for TSRs
|
---|
| 28 | SET_INTERRUPT_VECTOR EQU 25h
|
---|
| 29 | GET_INTERRUPT_VECTOR EQU 35h
|
---|
| 30 |
|
---|
[41] | 31 | ; DOS errors
|
---|
| 32 | ERR_DOS_DRIVE_NOT_READY EQU 15h
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | ; DOS Program Segment Prefix (PSP, first 256 (100h) bytes on top of program)
|
---|
| 37 | struc PSP
|
---|
| 38 | .int20hInstruction resb 2
|
---|
| 39 | .wSizeOfMemoryInParagraphs resb 2
|
---|
| 40 | .reservedAt4h resb 1
|
---|
| 41 | .callToDosFunctionDispatcher resb 5
|
---|
| 42 | .fpInt22hTerminate resb 4
|
---|
| 43 | .fpInt23hCtrlC resb 4
|
---|
| 44 | .fpInt24hCriticalError resb 4
|
---|
| 45 | .reservedAt16h resb 22
|
---|
| 46 | .wEnvironmentSegment resb 2
|
---|
| 47 | .reservedAt2Eh resb 34
|
---|
| 48 | .int21hAndRetfInstructions resb 3
|
---|
| 49 | .reservedAt53h resb 9
|
---|
| 50 | .FCB1 resb 16
|
---|
| 51 | .FCB2 resb 20
|
---|
| 52 | .DiskTransferArea:
|
---|
| 53 | .bCommandLineLength resb 1
|
---|
| 54 | .szCommandLine resb 127
|
---|
| 55 | endstruc
|
---|
| 56 |
|
---|
| 57 |
|
---|
| 58 | ; DOS DTA (Disk Transfer Area)
|
---|
| 59 | struc DTA
|
---|
| 60 | ; Undocumented fields
|
---|
| 61 | .reservedAt0h resb 21
|
---|
| 62 | ; Documented fields
|
---|
| 63 | .bFileAttributes resb 1 ; 15h, Attribute of matching file
|
---|
| 64 | .wFileTime resb 2 ; 16h, File time
|
---|
| 65 | .wFileDate resb 2 ; 18h, File date
|
---|
| 66 | .dwFileSize resb 4 ; 1Ah, File size in bytes
|
---|
| 67 | .szFile resb 13 ; 1Eh, ASCIZ filename + extension
|
---|
| 68 | endstruc
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | %endif ; DOS_FUNCTIONS_INC
|
---|