Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!charon!ariel.unm.edu!hansb From: hansb@ariel.unm.edu (The Amiga Programmer) Newsgroups: comp.sys.amiga Subject: poking and peeking around corners... Message-ID: <5001@charon.unm.edu> Date: 2 May 89 02:12:46 GMT Sender: root@charon.unm.edu Reply-To: hansb@ariel.unm.edu (The Amiga Programmer) Distribution: usa Organization: University of New Mexico, Albuquerque, NM Lines: 36 /* (Please, No Flames on this one) Ok, here is something that breaks all of the rules... Be warned! (this is for all those people that need a poke and peek function in C that used to use them in Basic) This can be modified to just peek a value, but currently it pokes and reads back from the memory location to insure success. Command: BASIC: poke address,byte C: pokepeek(address,byte); */ void pokepeek(d,c) unsigned char *d; /* pointer to destination */ unsigned char c; /* byte value to poke */ { *d=c; /* poke at location d */ printf("Hex Location $%x = %d\n",d,*d); /* peek at location */ } *********************** Hans Bechtel * Amiga is One / * * of The Best / * hansb@ariel.unm.edu ************** \/ ***** (505) 275-2797