🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc
Article #9206

Re: Direct memory access in Turbo C

#9206
From: Jeff Bakke
Date: Wed, 24 Jan 1990 08:21
22 lines
1276 bytes
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;

Then to access the byte at 0xB801 simply use
value = *(display+1);  /* if you set up display as a byte oriented pointer */

This should work fine.  Unlike pascal you can add/sub/inc/dec pointers in 
C.  Makes it much more flexible.

Jeff Bakke
bakke@plains.NoDak.edu
Technical Details
Message-ID: <3181@plains.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!ames!decwrl!ogicse!plains!bakke
References: <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!samsung!uakari.primate.wisc.edu!ames!decwrl!ogicse!plains!bakke
From: bakke@plains.UUCP (Jeff Bakke)
Newsgroups: comp.sys.ibm.pc
Subject: Re: Direct memory access in Turbo C
Message-ID: <3181@plains.UUCP>
Date: 24 Jan 90 08:21:17 GMT
References: <25b6a0d3:4290comp.sys.ibm.pc@vpnet.UUCP>
Reply-To: bakke@plains.UUCP (Jeff Bakke)
Organization: North Dakota State University, Fargo
Lines: 22