Release 950522
[wine/testsucceed.git] / miscemu / int26.c
blobde0aecf25861b71e022df252e88d294234f7490e
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "registers.h"
4 #include "msdos.h"
5 #include "ldt.h"
6 #include "wine.h"
7 #include "miscemu.h"
8 #include "dos_fs.h"
9 #include "stddebug.h"
10 /* #define DEBUG_INT */
11 #include "debug.h"
13 int do_int26(struct sigcontext_struct *context)
15 BYTE *dataptr = PTR_SEG_OFF_TO_LIN(DS, BX);
16 DWORD begin, length;
18 if(!DOS_ValidDrive(AL))
20 SetCflag;
21 AX = 0x0101; /* unknown unit */
23 /* push flags on stack */
24 SP -= sizeof(WORD);
25 setword(PTR_SEG_OFF_TO_LIN(SS,SP), (WORD) EFL);
26 return 1;
29 if (CX == 0xffff) {
30 begin = getdword(dataptr);
31 length = getword(&dataptr[4]);
32 dataptr = (BYTE *) PTR_SEG_TO_LIN(getdword(&dataptr[6]));
34 } else {
35 begin = DX;
36 length = CX;
39 dprintf_int(stdnimp,"int26: abs diskwrite, drive %d, sector %ld, "
40 "count %ld, buffer %d\n", (int)EAX & 0xff, begin, length, (int) dataptr);
42 ResetCflag;
44 /* push flags on stack */
45 SP -= sizeof(WORD);
46 setword(PTR_SEG_OFF_TO_LIN(SS,SP), (WORD) EFL);
48 return 1;