Path: utzoo!utgpu!watserv1!watsci!semicon From: semicon@watsci.uwaterloo.ca (Robert Adsett) Newsgroups: comp.sys.ibm.pc Subject: Re: Direct memory access in Turbo C Message-ID: <727@watserv1.waterloo.edu> Date: 24 Jan 90 23:35:49 GMT References: <25b6a0d3:4290comp.sys.ibm.pc@vpnet.UUCP> <3181@plains.UUCP> Sender: daemon@watserv1.waterloo.edu Reply-To: semicon@watsci.UUCP (Robert Adsett) Organization: University of Waterloo, Waterloo Ontario, Canada Lines: 35 In article <3181@plains.UUCP> bakke@plains.UUCP (Jeff Bakke) writes: >In article <25b6a0d3:4290comp.sys.ibm.pc@vpnet.UUCP> msm@vpnet.UUCP (Matt Minogue) writes: >> >> I am a fairly new C programmer, just converting from Pascal. I need to >>access screen memory at 0xb800 ... in Pascal I would use the array MemW[], >>but I can't seem to find a function in my Turbo C library to do this. Any >>help appreciated... > >Its a lot simpler to do in C than in Pascal. Simple do this... >set up a pointer to 0xB800 by > >unsigned int *display; >( or if you need byte size access ) >unsigned short int *display; Nope. 1) a short int is not byte sized it's word sized 2) To work in all models it should be a far pointer 3) the pointer is not initialized so it does not point at display memory It should be something like: #include unsigned char far *display = MK_FP( 0xb800, 0); Also take a look at gettext, puttext, movetext, getimage and putimage. They may already do what you want and you won't have to develop all the device specific code yourself. TC also has a set of routines that write directly to the screen. -- Robert Adsett Dept. of Phys, Univ. of Waterloo, Waterloo Ont. Canada