]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/CMD/FDISK/DOS.H

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / CMD / FDISK / DOS.H
1 /* dos.h
2 *
3 * Defines the structs and unions used to handle the input and output
4 * registers for the DOS interface routines defined in the V2.0 to V3.0
5 * compatability package. It also includes macros to access the segment
6 * and offset values of MS C "far" pointers, so that they may be used by
7 * these routines.
8 *
9 */
10
11 /* word registers */
12
13 struct WORDREGS {
14 unsigned ax;
15 unsigned bx;
16 unsigned cx;
17 unsigned dx;
18 unsigned si;
19 unsigned di;
20 unsigned cflag;
21 };
22
23 /* byte registers */
24
25 struct BYTEREGS {
26 unsigned char al, ah;
27 unsigned char bl, bh;
28 unsigned char cl, ch;
29 unsigned char dl, dh;
30 };
31
32 /* general purpose registers union - overlays the corresponding word and
33 * byte registers.
34 */
35
36 union REGS {
37 struct WORDREGS x;
38 struct BYTEREGS h;
39 };
40
41 /* segment registers */
42
43 struct SREGS {
44 unsigned es;
45 unsigned cs;
46 unsigned ss;
47 unsigned ds;
48 };
49
50 /* dosexterror struct */
51
52 struct DOSERROR {
53 int exterror;
54 char class;
55 char action;
56 char locus;
57 };
58
59 /* macros to break MS C "far" pointers into their segment and offset
60 * components
61 */
62
63 #define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
64 #define FP_OFF(fp) (*((unsigned *)&(fp)))
65
66 /* function declarations for those who want strong type checking
67 * on arguments to library function calls
68 */
69
70 #ifdef LINT_ARGS /* arg. checking enabled */
71
72 int bdos(int, unsigned int, unsigned int);
73 int dosexterr(struct DOSERROR *);
74 int intdos(union REGS *, union REGS *);
75 int intdosx(union REGS *, union REGS *, struct SREGS *);
76 int int86(int, union REGS *, union REGS *);
77 int int86x(int, union REGS *, union REGS *, struct SREGS *);
78 void segread(struct SREGS *);
79
80 #endif /* LINT_ARGS */
81 \1a