The REGS union elements used in C, equivalent to Assembly language have been in the table given next:
16-bit |
8-bit |
C language |
Assembly language |
C language |
Assembly language |
inregs.x.ax |
AX |
inregs.h.al |
AL |
|
|
inregs.h.ah |
AH |
inregs.x.bx |
BX |
inregs.h.bl |
BL |
|
|
inregs.h.bh |
BH |
inregs.x.cx |
CX |
inregs.h.cl |
CL |
|
|
inregs.h.ch |
CH |
inregs.x.dx |
DX |
inregs.h.dl |
DL |
|
|
inregs.h.dh |
DH |
inregs.x.si |
SI |
|
|
inregs.x.di |
DI |
|
|
inregs.x.cflag |
CF |
|
|
Let us see the examples of int86 and int86x functions. The Following Program Scans the every sector of the floppy disk and prints the status of every sector on the screen.
/* Program To Scan Every Sector Of The Floppy Disk and
Print the Status */
#include<dos.h>
#include<conio.h>
void main()
{
int head,track,sector,i;
char *buf;
union REGS inregs, outregs;
struct SREGS sregs;
clrscr();
|