Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!decvax!harpo!eagle!mhuxt!mhuxi!mhuxa!houxm!ihnp4!we13!burl!duke!mcnc!idis!pitt!hoffman
From: hoffman@pitt.UUCP
Newsgroups: net.micro
Subject: Re: etymology of peek and poke
Message-ID: <512@pitt.UUCP>
Date: Wed, 20-Jul-83 09:53:37 EDT
Article-I.D.: pitt.512
Posted: Wed Jul 20 09:53:37 1983
Date-Received: Fri, 22-Jul-83 03:52:30 EDT
References: wivax.18452
Lines: 24

The Microsoft Basic interpreter that Bill Gates developed was
patterned after DEC's Basic-Plus.  I used Basic-Plus in 1974
on a PDP-11/40 running RSTS V4A and PEEK() was a built-in function.
The argument to peek was a 16-bit signed integer and it returned same.
To access the processor status word you could do a peek(-2).
Poke, however, was implemented via the SYS() function which used
a string as its argument.  The string contained pairs of bytes that
represented the address and the value for the poke.  Both of these
calls were privileged -- poke, for the obvious reason, and peek because
peeking at an odd address would cause a fatal crash.  BTW, RSTS V4
ran in 28K and didn't know about memory management, therefore no
protection.

This information comes from the RSTS-11 System Manager's Guide,
DEC-11-ORSMA-B-D, dated January 1973.  The copyright dates on
this manual are 1971, 1972, and 1973.  Maybe someone with an earlier
version can verify when PEEK appeared.

As an aside, the names PEEK and POKE appear in the DECsystem-10
Assembly Language Handbook from 1972.  They were privileged
monitor calls there.

	---Bob Hoffman, Pitt CS		pitt!hoffman
					hoffman.pitt@Udel-Relay