Mail Archives: djgpp/1996/01/12/04:52:31
Hi all,
Should int86() work with djgpp? This program compiles OK, but no matter
what I set the underlined numbers to I always simply get the relevant
characters printed as if I hadn't bothered to use goto_xy() at all..
Any ideas?
TIA,
Charles.
#include<stdio.h>
#include<bios.h>
#include<dos.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
void goto_xy(int x, int y);
struct WORDREGS { unsigned int ax,bx,cx,dx,si,di,cflag,flags; };
struct BYTEREGS { unsigned char al,ah,bl,bh,cl,ch,dl,dh;};
main()
{
int a,x,y, ans;
unsigned int *p;
x = 3;
y = 1;
goto_xy(0,0);
system("cls");
for(a=1; a<=20;a++)
{
goto_xy(9,a);
^^^
putchar(179);
goto_xy(1,a);
^^^
putchar(167);
}
}
void goto_xy(int x, int y)
{
union REGS r;
r.h.ah = 2;
r.h.dl = x;
r.h.dh = y;
r.h.bh = 0;
int86(0x10, &r, &r);
}
- Raw text -