Well, this function uses no external functions to move the hardware cursor. It's made for DJGPP, yet I haven't tested it in DOS.
Code:
signed short int Put_Cursor(unsigned short int col, unsigned short int row)
{
unsigned short int offset;
// If coordinates are legit, move that sucker.
if((col < 81) && (col > 0) && (row < 26) && (row > 0))
{
// Calculate offset.
offset = (row - 1) * 80 + (col - 1);
// Move it.
asm volatile ("outb %%al,%%dx": :"d" 0x3D4, "a" 0x0F);
asm volatile ("outb %%al,%%dx": :"d" 0x3D5, "a" ((unsigned char)(offset & 0xFF)));
asm volatile ("outb %%al,%%dx": :"d" 0x3D4, "a" 0x0E);
asm volatile ("outb %%al,%%dx": :"d" 0x3D5, "a" ((unsigned char)((offset >> 8) & 0xFF)));
return 0;
}
return -1;
}