Path: utzoo!utgpu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!maccs!cs4g6ag From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: reading directly from screen Message-ID: <260AD02D.24787@maccs.dcss.mcmaster.ca> Date: 24 Mar 90 01:41:00 GMT References: <3850@plains.UUCP> Reply-To: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Organization: McMaster University, Hamilton, Ontario Lines: 24 In article <3850@plains.UUCP> person@plains.UUCP (Brett G. Person) writes: $How do I make Microsoft C read directly from video memory. I need to $access the memory starting from b800. $What does the c code that allows me to do this look like? You make a far pointer to an integer and set it to point to 0xb8000000. The ith word of display memory is then (let's say your pointer is called foo) *(foo + i), where the high byte is the attribute and the low byte is the character. MSC may have similar functions to Turbo C's gettext () and puttext () that allow you to save and restore rectangular chunks of text, if that's all you need to do. Also, please note that code written using your assumption that video memory starts at b800 will not work on monochrome systems, and also may not work on the occasional PC whose user has selected a display page other than the first. It would be a good idea to find out exactly where the video memory is before trying to access it. -- Stephen M. Dunn cs4g6ag@maccs.dcss.mcmaster.ca = "\nI'm only an undergraduate!!!\n"; **************************************************************************** "So sorry, I never meant to break your heart ... but you broke mine."