[41] | 1 | ; File name : DosFunctions.inc
|
---|
| 2 | ; Project name : AssemblyLibrary
|
---|
| 3 | ; Created date : 1.9.2010
|
---|
| 4 | ; Last update : 3.9.2010
|
---|
| 5 | ; Author : Tomi Tilli
|
---|
| 6 | ; Description : Defines for MS-DOS functions.
|
---|
| 7 | %ifndef DOS_FUNCTIONS_INC
|
---|
| 8 | %define DOS_FUNCTIONS_INC
|
---|
| 9 |
|
---|
| 10 | ; DOS interrupts
|
---|
| 11 | DOS_INTERRUPT_21h EQU 21h
|
---|
| 12 | DOS_CRITICAL_ERROR_HANDLER_24h EQU 24h
|
---|
| 13 |
|
---|
| 14 | ; DOS file functions
|
---|
| 15 | SELECT_DEFAULT_DRIVE EQU 0Eh
|
---|
| 16 | GET_CURRENT_DEFAULT_DRIVE EQU 19h
|
---|
| 17 | SET_INTERRUPT_VECTOR EQU 25h
|
---|
| 18 | GET_DISK_TRANSFER_AREA_ADDRESS EQU 2Fh
|
---|
| 19 | GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE EQU 32h
|
---|
| 20 | SET_CURRENT_DIRECTORY EQU 3Bh
|
---|
| 21 | OPEN_EXISTING_FILE EQU 3Dh
|
---|
| 22 | CLOSE_FILE EQU 3Eh
|
---|
| 23 | READ_FROM_FILE_OR_DEVICE EQU 3Fh
|
---|
| 24 | WRITE_TO_FILE_OR_DEVICE EQU 40h
|
---|
| 25 | SET_CURRENT_FILE_POSITION EQU 42h
|
---|
| 26 | GET_CURRENT_DIRECTORY EQU 47h
|
---|
| 27 | FIND_FIRST_MATCHING_FILE EQU 4Eh
|
---|
| 28 | FIND_NEXT_MATCHING_FILE EQU 4Fh
|
---|
| 29 |
|
---|
| 30 | ; DOS errors
|
---|
| 31 | ERR_DOS_DRIVE_NOT_READY EQU 15h
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | ; File attribute flags
|
---|
| 35 | FLG_FILEATTR_READ_ONLY EQU (1<<0)
|
---|
| 36 | FLG_FILEATTR_HIDDEN EQU (1<<1)
|
---|
| 37 | FLG_FILEATTR_SYSTEM EQU (1<<2)
|
---|
| 38 | FLG_FILEATTR_VOLUME_LABEL EQU (1<<3)
|
---|
| 39 | FLG_FILEATTR_DIRECTORY EQU (1<<4)
|
---|
| 40 | FLG_FILEATTR_ARCHIVE EQU (1<<5)
|
---|
| 41 |
|
---|
| 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
|
---|