segread Function
This function has been defined in dos.h. This function reads the segment registers. The declaration of the function is as follows:
void segread(struct SREGS *segp);
where segread puts the current values of the segment registers into the structure *segp. Nothing is returned by the function and the call is intended for use with intdosx and int86x. let us see an example:
#include <stdio.h>
#include <dos.h>
void main()
{
struct SREGS segs;
segread(&segs);
printf("Current segment register settings\n\n");
printf("CS: %X DS: %X\n", segs.cs, segs.ds);
printf("ES: %X SS: %X\n", segs.es, segs.ss);
getch();
}
And the output of the program will be something like this:
Current segment register settings
CS: EED DS: 10BA
ES: 10BA SS: 10BA |
intdos and intdosx Functions
These functions have been defined in dos.h. These are the general DOS interrupt interfaces. The function intdos invokes MS-DOS service registers then DX and AL where the function intdosx invokes MS-DOS service with segment register values.
The Declaration of the intdos function is as follows:
int intdos(union REGS *inregs, union REGS *outregs);
and the declaration of intdosx function is as:
int intdosx(union REGS *inregs, union REGS *outregs,
struct SREGS *segregs);
|