🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #33087

Re: Modula2 and Peeking

#33087
From: Deryck F Brown
Date: Fri, 01 Jul 1988 16:17
24 lines
1162 bytes
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
Technical Details
Message-ID: <1461@crete.cs.glasgow.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!strath-cs!glasgow!browndf
References: <490@dalcsug.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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