17 #define DOSVERSION 0x0330;
19 #define EAX context->sc_eax
20 #define EBX context->sc_ebx
21 #define ECX context->sc_ecx
22 #define EDX context->sc_edx
24 #define AX (context->sc_eax & 0x0000ffffL)
25 #define BX (context->sc_ebx & 0x0000ffffL)
26 #define CX (context->sc_ecx & 0x0000ffffL)
27 #define DX (context->sc_edx & 0x0000ffffL)
29 #define CS context->sc_cs
30 #define DS context->sc_ds
31 #define ES context->sc_es
33 #define DI context->sc_edi
34 #define SI context->sc_esi
36 #define EFL context->sc_efl
38 #define SetCflag (EFL |= 0x00000001L)
39 #define ResetCflag (EFL &= 0xfffffffeL)
41 #define pointer(a,b) (BYTE*)(((WORD) a << 16) | b)
42 #define segment(a) ((DWORD)a >> 16)
43 #define offset(a) ((DWORD)a & 0xffff)
45 #define setword(a,b) *(BYTE*)a = b & 0xff; \
46 *((BYTE*)a + 1) = (b>>8) & 0xff;
48 #define setdword(a,b) *(BYTE*)a = b & 0xff; \
49 *((BYTE*)a + 1) = (b>>8) & 0xff; \
50 *((BYTE*)a + 2) = (b>>16) & 0xff; \
51 *((BYTE*)a + 3) = (b>>24) & 0xff;
53 #define getword(a) (WORD) *(BYTE*)a + \
54 (*((BYTE*)a + 1) << 8)
56 #define getdword(a) (DWORD) (*(BYTE*)a + \
57 (*((BYTE*)a + 1) << 8) + \
58 (*((BYTE*)a + 2) << 16) + \
59 (*((BYTE*)a + 3) << 24))
61 /* dos file attributes */
63 #define FA_NORMAL 0x00 /* Normal file, no attributes */
64 #define FA_RDONLY 0x01 /* Read only attribute */
65 #define FA_HIDDEN 0x02 /* Hidden file */
66 #define FA_SYSTEM 0x04 /* System file */
67 #define FA_LABEL 0x08 /* Volume label */
68 #define FA_DIREC 0x10 /* Directory */
69 #define FA_ARCH 0x20 /* Archive */
71 /* extended error codes */
74 #define InvalidFunction 0x01
75 #define FileNotFound 0x02
76 #define PathNotFound 0x03
77 #define AccessDenied 0x05
78 #define InvalidHandle 0x06
79 #define MCBDestroyed 0x07
80 #define OutOfMemory 0x08
81 #define MCBInvalid 0x09
82 #define DataInvalid 0x0d
83 #define InvalidDrive 0x0f
84 #define CanNotRemoveCwd 0x10
85 #define NotSameDevice 0x11
86 #define NoMoreFiles 0x12
87 #define WriteProtected 0x13
88 #define UnknownUnit 0x14
89 #define DriveNotReady 0x15
90 #define UnknownCommand 0x16
92 #define BadRqLength 0x18
93 #define SeekError 0x19
94 #define UnknownMedia 0x1a
95 #define SectorNotFound 0x1b
96 #define OutOfPaper 0x1c
97 #define WriteFault 0x1d
98 #define ReadFault 0x1e
99 #define GeneralFailure 0x1f
100 #define ShareViolation 0x20
101 #define LockViolation 0x21
102 #define DiskFull 0x27
103 #define NoNetwork 0x49
104 #define FileExists 0x50
105 #define CanNotMakeDir 0x52
109 #define EC_Temporary 0x02
110 #define EC_AccessDenied 0x03
111 #define EC_AppError 0x04
112 #define EC_SystemFailure 0x06
113 #define EC_NotFound 0x08
114 #define EC_MediaError 0x0b
115 #define EC_Exists 0x0c
116 #define EC_Unknown 0x0d
118 /* Suggested actions */
120 #define SA_Retry 0x01
121 #define SA_Abort 0x04
122 #define SA_Ignore 0x06
123 #define SA_Ask4Retry 0x07
127 #define EL_Unknown 0x01
129 #define EL_Network 0x03
130 #define EL_Memory 0x05
132 #endif /* __MSDOS_H */