[comp.sys.ibm.pc] Direct video access

forumexp@rpitsmts.UUCP (09/16/87)

   I know you can get the current MODEM and video PAGE from
   INT 0x10. These numbers are also stored in low (0:400) memory.
   Are the values in low memory always (100%) accurate?

   Also, I've come up with some direct video read/write routines.
   I seem to get trouble when I use pointers (*vidp = buf[i], etc.
   where vidp is a far pointer pointing to the current video page)
   but if I use PEEKs and POKEs I have no problems. Is there
   a problem with using far pointers (vidp = ((unsigned char *) 0xB800)

ccs016@deneb.UUCP (09/17/87)

> 
>    I know you can get the current MODEM and video PAGE from
>    INT 0x10. These numbers are also stored in low (0:400) memory.
>    Are the values in low memory always (100%) accurate?
> 
>    Also, I've come up with some direct video read/write routines.
>    I seem to get trouble when I use pointers (*vidp = buf[i], etc.
>    where vidp is a far pointer pointing to the current video page)
>    but if I use PEEKs and POKEs I have no problems. Is there
>    a problem with using far pointers (vidp = ((unsigned char *) 0xB800)

     Yes, you forgot the offset. Just add on more 0's on your address. 
 
main()
{
  long address = 0xb800000;
  char far buf;
  int x;

  buf = (char far *) address;
  for (x=1;x<4000;x+=2)        /* skip the attributes */
      printf("%c",*buf++);
}
  
     This should work. I just wrote this so please don flame me. However,
it has worked in the past. 
 
Patrick Tully
pstully@ucdavis