[comp.sys.ibm.pc] Getting at screen memory with MSC

person@sparky.UUCP (Brett G. Person) (11/17/89)

I need to access screen memory directly under microsoft C( actually QuickC).
I know that the answer is to use a pointer to screen memory, but I don't
know how to do this in C. This is probably painfully simple, but I don't
know how to do it. 
What I need to do is read screen memory starting at $b000:$8000 ( cga text
mode).  respond via e-mail

Thanks in Advance.
-- 
Brett G. Person
North Dakota State University
uunet!ndsuvax!ncperson | ncperson@ndsuvax.bitnet | ncperson@plains.nodak.edu

fredex@cg-atla.UUCP (Fred Smith) (11/28/89)

In article <2922@sparky.UUCP> person@sparky.UUCP (Brett G. Person) writes:
>
>I need to access screen memory directly under microsoft C( actually QuickC).
>I know that the answer is to use a pointer to screen memory, but I don't
>know how to do this in C. This is probably painfully simple, but I don't
>know how to do it. 
>What I need to do is read screen memory starting at $b000:$8000 ( cga text
>mode).  respond via e-mail
>



Try:

	char far * screen_memory;

	FP_SEG(screen_memory) = 0xb000;
	FP_OFF(screen_memory) = 0x0000;

Note that this MUST be a FAR pointer regardless of memory model, since it 
does NOT lie in any segment which is allocated to your program.

Hope this is adequate help.

Fred