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