home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
C-ASM_VI.ARJ
/
PROGC.ZIP
/
PROGC003.C
< prev
next >
Wrap
Text File
|
1988-05-15
|
872b
|
21 lines
/************************************************************************/
/* Get cursor position by reading CRTC registers E and F */
/************************************************************************/
read_cursor_address()
{
#define MONO 5
#define VMONO 7
int hi, lo, port;
if (get_display_type() == MONO || get_display_type() == VMONO)
port = 0x3B4;
else
port = 0x3D4;
write_register(port, 0x0E); /* Select register index */
hi = read_register(port+1); /* Get register value */
write_register(port, 0x0F); /* Select register */
lo = read_register(port+1); /* Get register value */
printf("\nCursor is at %x hex", hi * 256 + lo);
}