home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!psinntp!ptsys1!mliu
- From: mliu@pt.com (Fred Liu)
- Subject: Re: Peek/Poke in C
- Message-ID: <1992Dec24.141443.6191@pt.com>
- Organization: Performance Technologies, Incorporated
- References: <pal.724673747@regent.e-technik.tu-muenchen.de> <mLF0VB1w165w@wozzle.linet.org>
- Date: Thu, 24 Dec 1992 14:14:43 GMT
- Lines: 26
-
- In article <mLF0VB1w165w@wozzle.linet.org> alane@wozzle.linet.org (J. Alan Eldridge) writes:
- >pal@regent.e-technik.tu-muenchen.dbp.de (Peter Loibl) writes:
- >
- >> ericwebb@blackwlf.gwinnett.com (eric webb) writes:
- >>
- >> >Hi again.. does anyone know how to do equivalent of BASIC's PEEK & POKE
- >> >statements in C?
- >>
- >> I am sorry for my ignorance, but what are PEEK and POKE doing? If you
- >> describe their task, then this would be lots of help for all the
- >> "C-Gurus" here.
- >
- >peek and poke are to access absolute memory addresses under DOS.
-
- There is peek() and poke() available on Sun systems for writing
- device drivers. They are kernel routines and can only be used
- by device drivers. Peek() and poke() are not standard C functions.
- However, if you are writing a standalone program, you will be
- able to access physical addresses using assignment statements.
- Here is an example: *(char *)0xABCDEF00 = 0xAB; or if your
- compiler does not allow this, you could try: (char *)ptr = 0xABCDEF00;
- *ptr = 0xAB;
-
- --
- Fred Liu, Performance Technologies Incorporated mliu@pt.com
- 315 Science Parkway, Rochester, New York 14620 uupsi!ptsys1!mliu
-