Release 950817
[wine/multimedia.git] / miscemu / int26.c
blob06f70ed68f50d5a61be5e7df3589d0193acaa26e
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 /**********************************************************************
14 * INT_Int26Handler
16 * Handler for int 26h (absolute disk read).
18 void INT_Int26Handler( struct sigcontext_struct context )
20 BYTE *dataptr = PTR_SEG_OFF_TO_LIN( DS_reg(&context), BX_reg(&context) );
21 DWORD begin, length;
23 if (!DOS_ValidDrive(AL_reg(&context)))
25 SET_CFLAG(&context);
26 AX_reg(&context) = 0x0101; /* unknown unit */
27 return;
30 if (CX_reg(&context) == 0xffff)
32 begin = getdword(dataptr);
33 length = getword(&dataptr[4]);
34 dataptr = (BYTE *) PTR_SEG_TO_LIN(getdword(&dataptr[6]));
36 else
38 begin = DX_reg(&context);
39 length = CX_reg(&context);
42 dprintf_int( stdnimp,"int26: abs diskwrite, drive %d, sector %ld, "
43 "count %ld, buffer %d\n",
44 AL_reg(&context), begin, length, (int) dataptr );
46 RESET_CFLAG(&context);