| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Cursor manipulation |
06 Jul 95 18:58, Bek Oberin wrote to All:
> A long, long, time ago I had some cursor manipulation routines in
> assembler... I think. At least, I haven't got any now and I need
> 'em - nothing fancy, just on/off.
This isn't quite _true_ assembler, but hopefully it should help. :-) It
was included with the SNIPPETS 'C' source archive maintained by Bob Stout.
/*****************************************************************/
/** CURSOR() **/
/** ARGUMENTS: A char variable identifiny what to do with **/
/** the cursor. **/
/** RETURN: none **/
/** **/
/** DESCRIPTION: This function receives a character which **/
/** tells it to do one of several things. **/
/** Turn the cursor on or off, or save the **/
/** cursor positon, or restore the position. **/
/** **/
/** BY Bill Wilkie, 1988 **/
/*****************************************************************/
#include
static int position; /* global to hold cursor postion */
void cursor(char tmp)
{
union REGS inregs,outregs; /* cpu registers */
switch(tmp)
{
case 'h' : /* CURSOR OFF */
inregs.h.ah = 1; /* set cursor size */
inregs.h.ch = 0x20; /* set bit turns cursor off */
int86(0x10,&inregs,&outregs);
break;
case 's' : /* SAVE CURSOR POSITION */
inregs.h.ah = 3; /* read cursor positon and size */
inregs.h.bh = 0; /* from page zero */
int86(0x10,&inregs,&outregs);
position = outregs.x.dx; /* store positon */
break;
case 'r' : /* RESTORE CURSOR POSITON */
inregs.h.ah = 2; /* set cursor positon */
inregs.h.bh = 0; /* on page zero */
inregs.x.dx = position; /* at this old position */
int86(0x10,&inregs,&outregs);
break;
case 'o' : /* CURSOR ON */
inregs.h.ah = 1; /* set cursor size */
inregs.h.ch = 6; /* cursor start line */
inregs.h.cl = 7; /* cursor end line */
int86(0x10,&inregs,&outregs);
break;
}
}
andrew
--- Msgedsq/2 3.10
* Origin: This one HAS to be original X (3:633/267.1{at}fidonet)SEEN-BY: 50/99 632/348 998 633/246 252 253 260 267 371 373 634/384 635/503 SEEN-BY: 635/513 544 638/100 639/100 120 640/230 690/718 711/401 410 430 807 SEEN-BY: 711/808 809 934 713/888 800/1 7877/2809 @PATH: 633/267 252 371 635/503 50/99 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.