home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!csd4.csd.uwm.edu!pegasus
- From: pegasus@csd4.csd.uwm.edu (David R Hucke)
- Subject: re: converting Borland peekb and pokeb to Microsoft
- Message-ID: <1992Jul30.024656.11608@uwm.edu>
- Originator: pegasus@csd4.csd.uwm.edu
- Sender: news@uwm.edu (USENET News System)
- Organization: Computing Services Division, University of Wisconsin - Milwaukee
- Date: Thu, 30 Jul 1992 02:46:56 GMT
- Lines: 43
-
- Hope this helps...
-
- I don't know what pokeb and peekb do, but they sound like they put
- a value to a memory address and check a memory address...
-
- If this is the case you can do something like this:
-
- char far *MemPtr
- #include <stdio.h>
-
- main()
- {
-
- char far *MemPtr; /* Ptr to a byte in memory */
- char data;
-
- MemPtr = (char far *) 0xB8000000L;
- /* this points to address in memory you want to work on.
- In the above B800 is the segment and 0000 is the
- offset */
- data = *MemPtr;
- /* This line should be equal to peekb(address) where the address
- was set by the first line. Your function could then return the
- value of data. */
-
- *MemPtr = 112;
- /* This is equivalent then to pokeb(address,112).
- You could in the pointer to the memory location instead
- of how I did it here. */
- }
-
-
- This code was written for Microsoft Quick C v 2.5 and should work on any
- Microsoft C compiler. (Note: turn pointer checks off)
-
- Please let me know if this helps you out...
-
- ===
- pegasus@csd4.csd.uwm.edu
- --
- pegasus@csd4.csd.uwm.edu David R. Hucke
- UW-Milwaukee Film Major
- --
-