Release 970202
[wine/multimedia.git] / msdos / int26.c
blob09ee5261b169923843f1fa94fe2be8d23645da50
1 /*
2 * DOS interrupt 26h handler
3 */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include "msdos.h"
8 #include "ldt.h"
9 #include "miscemu.h"
10 #include "drive.h"
11 #include "stddebug.h"
12 /* #define DEBUG_INT */
13 #include "debug.h"
15 /**********************************************************************
16 * INT_Int26Handler
18 * Handler for int 26h (absolute disk read).
20 void INT_Int26Handler( CONTEXT *context )
22 BYTE *dataptr = PTR_SEG_OFF_TO_LIN( DS_reg(context), BX_reg(context) );
23 DWORD begin, length;
25 if (!DRIVE_IsValid(AL_reg(context)))
27 SET_CFLAG(context);
28 AX_reg(context) = 0x0101; /* unknown unit */
29 return;
32 if (CX_reg(context) == 0xffff)
34 begin = *(DWORD *)dataptr;
35 length = *(WORD *)(dataptr + 4);
36 dataptr = (BYTE *)PTR_SEG_TO_LIN( *(SEGPTR *)(dataptr + 6) );
38 else
40 begin = DX_reg(context);
41 length = CX_reg(context);
44 dprintf_int( stdnimp,"int26: abs diskwrite, drive %d, sector %ld, "
45 "count %ld, buffer %d\n",
46 AL_reg(context), begin, length, (int) dataptr );
48 RESET_CFLAG(context);