delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/12/04:52:31

From: Charles Brasted <cbrasted AT physics DOT adelaide DOT edu DOT au>
Subject: int86()
To: djgpp AT delorie DOT com
Date: Fri, 12 Jan 1996 19:53:56 +1030 (CST)

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019