delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/07/12/10:19:01

From: Andreas Pfau <pfau AT ind DOT e-technik DOT uni-stuttgart DOT de>
Subject: help
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Tue, 12 Jul 94 15:15:59 METDST
Mailer: Elm [revision: 70.85]

Dear Mr.Delorie and any users of GNU C,

herewith I kindly request a little help with a small problem
of mine. In a 'regular' DOS-C program I used the following routine
to send data to a 16-bit-data-register of a PC-add-on-board which was
developed for test purpose.

unsigned short far *adr;
unsigned short val=0xffff;      /* dummy value */
adr=0xD0000000; /* simplified; 
                   normally a MACRO MK_FP is used to set SEGMENT 
                   and OFFSET address in the PC memory space */
*adr=val;       /* send 16 bit value val to register at 0xD0000 */

Now I have to translate this little program to the GNU C environment.
I tried the dosmemput/dosmemget functions but they only work on bytes
i.e. 8 bits properly. What I need is a function that copies 16 bit
directly to the PC's conventional memory area.
One possibility would be to rewrite the source dosmem.s and recompile
the standard C library. It is obvious that it is preferable to use a
library function that does the trick.
So if you might give me a little advise I would be very grateful.
Thank you and Bye Bye.
pfau AT ind DOT e-technik DOT uni-stuttgart DOT de


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019