Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!oddjob!mimsy!rab From: rab@mimsy.UUCP (Bob Bruce) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: Looking for C functions to access PC memory Message-ID: <9305@mimsy.UUCP> Date: Wed, 11-Nov-87 17:08:37 EST Article-I.D.: mimsy.9305 Posted: Wed Nov 11 17:08:37 1987 Date-Received: Sat, 14-Nov-87 05:56:51 EST References: <24261F3U@PSUVMB> <447@ucdavis.ucdavis.edu> <261@grinch.grinch.UUCP> Reply-To: rab@mimsy.UUCP (Bob Bruce) Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 23 Keywords: Using pointer in C Xref: mnetor comp.sys.ibm.pc:10035 comp.lang.c:5380 Followup-To: In article <261@grinch.grinch.UUCP> luis@grinch.UUCP (Luis Chanu) writes: >In article <447@ucdavis.ucdavis.edu> kwok@iris.UUCP (Conrad Kwok) writes: >> ... >> ptr = (char far *) 0xC0000100L; > > 1. Why is there an 'L' at the end of the address? (does it stand for Long?) Yes, it stands for long. Many compilers have 32 bit pointers and 16 bit int's. Appending an `L' to a constant is equivalent to casting it to a long. In an assignment, such as this, the `L' is not necessary, but it does emphasize that the constant is bigger than an int. > 2. I have been trying to access the DTR on my modem, but I don't know > what the base address is. From the Technical Reference, I know that > the offset is 3FE (bit 0), but can't find the base address. Can anyone > help? Sorry, but the 3FE is a port address, not a memory location. Check your compiler manual. It should provide some library routines for accessing I/O ports. Usually something like `outp()' and `inp()'. If these are not provided then you are going to have to write some assembly language routines.