Release 941017
[wine/gsoc-2012-control.git] / miscemu / int26.c
blob6abe98820f2839558fdfb16ac6f3649bdad57d4a
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "registers.h"
4 #include "msdos.h"
5 #include "wine.h"
6 #include "stddebug.h"
7 /* #define DEBUG_INT */
8 /* #undef DEBUG_INT */
9 #include "debug.h"
11 void IntBarf(int i, struct sigcontext_struct *context);
13 int do_int26(struct sigcontext_struct *context)
15 BYTE *dataptr = pointer(DS, BX);
16 DWORD begin, length;
18 if (CX == 0xffff) {
19 begin = getdword(dataptr);
20 length = getword(&dataptr[4]);
21 dataptr = (BYTE *) getdword(&dataptr[6]);
23 } else {
24 begin = DX;
25 length = CX;
28 dprintf_int(stdnimp,"int26: abs diskwrite, drive %d, sector %d, count %d,"
29 " buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
31 ResetCflag;
33 /* push flags on stack */
34 SP -= sizeof(WORD);
35 setword(pointer(SS,SP), (WORD) EFL);
37 return 1;