Release 940815
[wine/gsoc-2012-control.git] / miscemu / int25.c
blobaf79ec46e296d66ac4ea566360c4e39e02a123cf
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "registers.h"
4 #include "msdos.h"
5 #include "wine.h"
7 int do_int25(struct sigcontext_struct *context)
9 BYTE *dataptr = pointer(DS, BX);
10 DWORD begin, length;
12 if (CX == 0xffff) {
13 begin = getdword(dataptr);
14 length = getword(&dataptr[4]);
15 dataptr = (BYTE *) getdword(&dataptr[6]);
17 } else {
18 begin = DX;
19 length = CX;
21 fprintf(stderr, "int25: abs diskread, drive %d, sector %d, "
22 "count %d, buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
24 memset(dataptr, 0, length * 512);
26 if (begin == 0 && length > 1)
27 *(dataptr + 512) = 0xf8;
29 if (begin == 1)
30 *dataptr = 0xf8;
32 ResetCflag;
34 /* push flags on stack */
35 SP -= sizeof(WORD);
36 setword(pointer(SS,SP), (WORD) EFL);
38 return 1;