Article View: comp.sys.ibm.pc
Article #9264Re: Direct memory access in Turbo C
From: Jeff S. Olsen
Date: Wed, 24 Jan 1990 19:40
Date: Wed, 24 Jan 1990 19:40
28 lines
975 bytes
975 bytes
to set up a pointer to the screen in turbo-c, do this:
#include <dos.h>
typedef struct cell {
char letter;
char attrib;
} CELL;
main ()
{
CELL far *screen;
screen = MK_FP(0xb800,0x0000); /* this is for the color screen */
/* whatever you want here */
}
you could just make the screen char far *screen if you wanted to
deal with letter and attrib yourself. The important part is the "far"
and the MK_FP which stands for make far pointer (which is a macro, so
you must include dos.h).
hope this helps.
Jeff Olsen
olsen@eecs.nwu.edu
Technical Details
Message-ID:
<3580024@eecs.nwu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!mailrus!accuvax.nwu.edu!nucsrl!olsenReferences:
<25b6a0d3:4290comp.sys.ibm.pc@vpnet.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!mailrus!accuvax.nwu.edu!nucsrl!olsen From: olsen@eecs.nwu.edu (Jeff S. Olsen) Newsgroups: comp.sys.ibm.pc Subject: Re: Direct memory access in Turbo C Message-ID: <3580024@eecs.nwu.edu> Date: 24 Jan 90 19:40:53 GMT References: <25b6a0d3:4290comp.sys.ibm.pc@vpnet.UUCP> Organization: Northwestern U, Evanston IL, USA Lines: 28