Release 960114
[wine/gsoc-2012-control.git] / miscemu / int26.c
blob53f1abc4bbb76043fe2b794749e8ed8ed684f1eb
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 "drive.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 (!DRIVE_IsValid(AL_reg(&context)))
25 SET_CFLAG(&context);
26 AX_reg(&context) = 0x0101; /* unknown unit */
27 return;
30 if (CX_reg(&context) == 0xffff)
32 begin = *(DWORD *)dataptr;
33 length = *(WORD *)(dataptr + 4);
34 dataptr = (BYTE *)PTR_SEG_TO_LIN( *(SEGPTR *)(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);