Path: utzoo!attcan!uunet!mcvax!ukc!strath-cs!glasgow!browndf From: browndf@cs.glasgow.ac.uk (Deryck F Brown) Newsgroups: comp.sys.atari.st Subject: Re: Modula2 and Peeking Keywords: Peek, Memory, TDI, Modula2 Message-ID: <1461@crete.cs.glasgow.ac.uk> Date: 1 Jul 88 16:17:04 GMT References: <490@dalcsug.UUCP> Reply-To: browndf@cs.glasgow.ac.uk (Deryck F Brown) Organization: Comp Sci, Glasgow Univ, Scotland Lines: 24 The standard way to do memory addressing in Modula2 would be something like this... VAR p : POINTER TO INTEGER; (* 2-byte signed quantity *) contents : INTEGER; BEGIN p := ADDRESS(address); (* address you wish to peek *) contents := p^; (* do a peek *) p^ := contents; (* do a poke *) END. Obviously to access something which is in the ST's protected areas of memory (like the system timer variable) you would have to use the enter supervisor mode call first. To peek/poke quantities other than integers you would need pointers to other quantities e.g. POINTER TO BYTE, POINTER TO WORD, POINTER TO LONGWORD. ps BYTE, WORD, LONGWORD and ADDRESS all have to be imported from SYSTEM. Deryck