Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!mips!apple!vsi1!daver!intersil!hamilton From: hamilton@intersil.uucp (Fred Hamilton) Newsgroups: comp.sys.amiga.tech Subject: Reading absolute memory locations Message-ID: <75.25cde84e@intersil.uucp> Date: 5 Feb 90 20:55:42 GMT Organization: Harris Semiconductor, Santa Clara CA Lines: 42 Hello World. I'm rolling my own real time clock for my A1000. To read the registers, I have to address specific memory locations. I believe the correct way to do this is along the lines of "value = *(long *)address;" (stop me now if I've already blown it). So I wrote a program to read some addresses in the $00D80000-$00D80044 range (the same range the 500/2000's clock resides at), and I found I got this bizzare screen glitch when I read location $00D80028. Here is the program (compiled with Lattice 5.04a as "lc -L strange.c" ): main() { long i, value; long address = 0x00D80028; /* for(i=0;i<1000000;i++) */ value = *(long *)address; } If you run the program once the screen you run it on will "bounce". If you run it several times you will notice that sometimes the screen ends up a pixel higher than before you ran it, and sometimes it's a pixel lower. If you take out the commented loop, the screen will go berserk for a few seconds. So, what is it? A) I don't know how to program in C. (typical) B) My modified 1000 (LUCAS/FRANCES, CLtd HD controller) has become rather weird. C) The stock A1000 has something against people trying to read location $D80028. or D) Something else. All I was trying to do was read the value at location $D80028 :-( Any help will be appreciated. Even if you can't help, please let me know what the program does on your system if you try it. Thanks. -- Fred Hamilton Any views, comments, or ideas expressed here Harris Semiconductor are entirely my own. Even good ones. Santa Clara, CA