http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hi



The int86x seems to be the same:

The following example demonstrates the straight-forwardness of the function
call:

Sample Code

/* Compile options needed: none
*/

#include <stdio.h>
#include <dos.h>
#include <malloc.h>

/*****            WARNING!!!!!          ******/
/* If you change the following line so that DRIVE_A is assigned a 2 or
   above, you could destroy data on your hard drive. This test program
   segment was written to read and write from the floppy disk A:
*/
#define DRIVE_A 0                    /* 0=A, 1=B, 2=C, etc. */
#define ONE_SECTOR 1
#define ABS_WRITE 38                 /* Decimal value of int call */
#define ABS_READ 37                  /* Decimal value of int call */
unsigned int far *out;               /* Pointer to Data to be output
*/
unsigned int far *input;             /* Pointer to Data Transfer Area
*/
unsigned int output;                 /* Data to be output */
union REGS inregs, outregs;
struct SREGS segregs;
void main(void)  {
   out = &output;
   input = (unsigned int far *) malloc(1024 * sizeof(unsigned int));
   *out = 11;
   inregs.h.al = DRIVE_A;              /* Write to drive A */
   inregs.x.cx = ONE_SECTOR;           /* Write one sector only */
   inregs.x.dx = 3;                    /* Logical sector 3 */
   segregs.ds = FP_SEG(out);           /* Get Seg address of output */
   inregs.x.bx = FP_OFF(out);          /* Get Offset of output */
   outregs.x.ax = 0;                   /* No error */
   int86x (ABS_WRITE, &inregs, &outregs, &segregs);

   inregs.h.al = DRIVE_A;              /* Read to drive A */
   inregs.x.cx = ONE_SECTOR;           /* Read one sector only */
   inregs.x.dx = 3;                    /* Logical sector 3 */
   segregs.ds = FP_SEG(input);         /* Get Seg address of buffer */
   inregs.x.bx = FP_OFF(input);        /* Get Offset of buffer */
   outregs.x.ax = 0;                   /* No error */
   int86x (ABS_READ, &inregs, &outregs, &segregs);
   printf ("%u was read from drive A: \n", *input);
}

-----Message d'origine-----
De : 663 <663@fast.edu.pk>
À : 'gameprogrammer@gameprogrammer.com' <gameprogrammer@gameprogrammer.com>
Date : mercredi 5 avril 2000 11:04
Objet : Hi


>Hello there this is my second mail and you guys don't respond the first
>please i need the answer.
>
> "How will you use int386(REGS, REGS, int_no) in bc5.0 can you give
>me a sample code"
>=================================================================
>The GameProgrammer.Com mailing list is for the open discussion
>of any topic related to the art, science, and business of
>programming games. This list is especially tolerant of beginners.
>We were all beginners once
>
>To SUBSCRIBE or UNSUBSCRIBE please visit:
>http://gameprogrammer.com/mailinglist.html

=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html