Mail Archives: djgpp/1994/07/12/10:19:01
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 -