source: xtideuniversalbios/trunk/Assembly_Library/Inc/DosFunctions.inc @ 446

Last change on this file since 446 was 446, checked in by aitotat@…, 12 years ago

Changes to Assembly Library:

  • File Library can now create files.
File size: 2.0 KB
Line 
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
7DOS_INTERRUPT_21h                                   EQU     21h
8DOS_CRITICAL_ERROR_HANDLER_24h                      EQU     24h
9DOS_TSR_MULTIPLEX_INTERRUPT_2Fh                     EQU     2Fh
10
11; DOS drive and file functions
12SELECT_DEFAULT_DRIVE                                EQU     0Eh
13GET_CURRENT_DEFAULT_DRIVE                           EQU     19h
14GET_DISK_TRANSFER_AREA_ADDRESS                      EQU     2Fh
15GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE    EQU     32h
16SET_CURRENT_DIRECTORY                               EQU     3Bh
17CREATE_OR_TRUNCATE_FILE                             EQU     3Ch
18OPEN_EXISTING_FILE                                  EQU     3Dh
19CLOSE_FILE                                          EQU     3Eh
20READ_FROM_FILE_OR_DEVICE                            EQU     3Fh
21WRITE_TO_FILE_OR_DEVICE                             EQU     40h
22SET_CURRENT_FILE_POSITION                           EQU     42h
23GET_CURRENT_DIRECTORY                               EQU     47h
24FIND_FIRST_MATCHING_FILE                            EQU     4Eh
25FIND_NEXT_MATCHING_FILE                             EQU     4Fh
26
27; DOS functions for TSRs
28SET_INTERRUPT_VECTOR                                EQU     25h
29GET_INTERRUPT_VECTOR                                EQU     35h
30
31; DOS errors
32ERR_DOS_DRIVE_NOT_READY                             EQU     15h
33
34
35
36; DOS Program Segment Prefix (PSP, first 256 (100h) bytes on top of program)
37struc 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
55endstruc
56
57
58; DOS DTA (Disk Transfer Area)
59struc 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
68endstruc
69
70
71%endif ; DOS_FUNCTIONS_INC
Note: See TracBrowser for help on using the repository browser.