Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!fxgrp!ljz From: ljz@fxgrp.UUCP (Lloyd Zusman) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: Looking for C functions to access PC memory Message-ID: <156@fxgrp.UUCP> Date: Tue, 10-Nov-87 21:17:21 EST Article-I.D.: fxgrp.156 Posted: Tue Nov 10 21:17:21 1987 Date-Received: Fri, 13-Nov-87 04:07:23 EST References: <24261F3U@PSUVMB> <6662@brl-smoke.ARPA> Reply-To: ljz@fxgrp.UUCP (Lloyd Zusman) Followup-To: <6662@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Master Byte Software Lines: 17 Xref: mnetor comp.sys.ibm.pc:9992 comp.lang.c:5358 In article <6662@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >#define PEEK(loc) (*(char *)(loc)) >#define POKE(loc,value) *(char *)(loc) = (value) This would only work if you are using a large data model and the 'loc' variable is of the type long (or some other 32-bit thing). If you're using Microsoft C version 4.0 (which I believe you are if I don't have you mixed up with another contributor here), use the movedata() function, which I described in a recent posting. It'll work in all memory models. -- Lloyd Zusman, Master Byte Software, Los Gatos, California "We take things well in hand." ...!ames!fxgrp!ljz