knave
10-06-2005, 04:28 PM
hi, i'm working with some old hardware, a handheld x86 device from around 1992. It's a 16 bit device running MS DOS 5.0, and doesnt seem to work with C++ STLs, so I'm coding stuff for it in C using Microsoft Visual C++ Compiler 1.52.
now, i have a function to clear the screen, but i'm not totally sure how the function even works, just something to do with simulating an interrupt:
#include <dos.h>
void cls(void)
{
union REGS regs;
regs.h.ah = 0x06;
regs.h.al = 0;
regs.h.bh = 7;
regs.h.ch = 0;
regs.h.cl = 0;
regs.h.dh = 25;
regs.h.dl = 80;
int86(0x10, ®s, ®s);
}
this function erases everything onscreen, but leaves the input cursor wherever it happens to be...how could i return the cursor to the first position of the first line (top left corner)? or is there a better C function that will actually work on this old hardware?
i'd appreciate any help i can get
now, i have a function to clear the screen, but i'm not totally sure how the function even works, just something to do with simulating an interrupt:
#include <dos.h>
void cls(void)
{
union REGS regs;
regs.h.ah = 0x06;
regs.h.al = 0;
regs.h.bh = 7;
regs.h.ch = 0;
regs.h.cl = 0;
regs.h.dh = 25;
regs.h.dl = 80;
int86(0x10, ®s, ®s);
}
this function erases everything onscreen, but leaves the input cursor wherever it happens to be...how could i return the cursor to the first position of the first line (top left corner)? or is there a better C function that will actually work on this old hardware?
i'd appreciate any help i can get