Release 940804
[wine/gsoc-2012-control.git] / miscemu / int25.c
blob9a9a366aec60e310dd462b9809fa7b12d8ed82ea
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "msdos.h"
4 #include "wine.h"
6 int do_int25(struct sigcontext_struct *context)
8 BYTE *dataptr = pointer(DS, BX);
9 DWORD begin, length;
11 if( (ECX & 0xffff) == 0xffff)
13 begin = getdword(dataptr);
14 length = getword(&dataptr[4]);
15 dataptr = (BYTE *) getdword(&dataptr[6]);
17 } else {
18 begin = EDX & 0xffff;
19 length = ECX & 0xffff;
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;