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_CTRL_C_CTRL_BREAK_HANDLER_23h EQU 23h
|
---|
9 | DOS_CRITICAL_ERROR_HANDLER_24h EQU 24h
|
---|
10 | DOS_TSR_MULTIPLEX_INTERRUPT_2Fh EQU 2Fh
|
---|
11 |
|
---|
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+
|
---|
34 | GET_EXTENDED_ERROR_INFORMATION EQU 59h ; DOS 3.0+
|
---|
35 |
|
---|
36 | ; DOS errors
|
---|
37 | ERR_DOS_FUNCTION_NUMBER_INVALID EQU 01h
|
---|
38 | ERR_DOS_INVALID_DRIVE EQU 0Fh
|
---|
39 | ERR_DOS_DRIVE_NOT_READY EQU 15h
|
---|
40 |
|
---|
41 |
|
---|
42 | ; DOS Program Segment Prefix (PSP, first 256 (100h) bytes on top of program)
|
---|
43 | struc PSP
|
---|
44 | .int20hInstruction resb 2
|
---|
45 | .wSizeOfMemoryInParagraphs resb 2
|
---|
46 | .reservedAt4h resb 1
|
---|
47 | .callToDosFunctionDispatcher resb 5
|
---|
48 | .fpInt22hTerminate resb 4
|
---|
49 | .fpInt23hCtrlC resb 4
|
---|
50 | .fpInt24hCriticalError resb 4
|
---|
51 | .reservedAt16h resb 22
|
---|
52 | .wEnvironmentSegment resb 2
|
---|
53 | .reservedAt2Eh resb 34
|
---|
54 | .int21hAndRetfInstructions resb 3
|
---|
55 | .reservedAt53h resb 9
|
---|
56 | .FCB1 resb 16
|
---|
57 | .FCB2 resb 20
|
---|
58 | .DiskTransferArea:
|
---|
59 | .bCommandLineLength resb 1
|
---|
60 | .szCommandLine resb 127
|
---|
61 | endstruc
|
---|
62 |
|
---|
63 |
|
---|
64 | ; DOS DTA (Disk Transfer Area)
|
---|
65 | struc DTA
|
---|
66 | ; Undocumented fields
|
---|
67 | .reservedAt0h resb 21
|
---|
68 | ; Documented fields
|
---|
69 | .bFileAttributes resb 1 ; 15h, Attribute of matching file
|
---|
70 | .wFileTime resb 2 ; 16h, File time
|
---|
71 | .wFileDate resb 2 ; 18h, File date
|
---|
72 | .dwFileSize resb 4 ; 1Ah, File size in bytes
|
---|
73 | .szFile resb 13 ; 1Eh, ASCIZ filename + extension
|
---|
74 | endstruc
|
---|
75 |
|
---|
76 |
|
---|
77 | %endif ; DOS_FUNCTIONS_INC
|
---|