15

I've been reading manuals for BASIC implementations and the earliest reference I can find to PEEK, POKE, and USR is in the Altair BASIC 3.2 manual, published in 1975. This morning I came across this article, in the March 31, 1976 issue of the Homebrew Computing Newsletter: "Tiny BASIC is a proper subset of Dartmouth BASIC... For the 6800, this language has been augmented to include the functions RND, USR, and PEEK and POKE, giving the user access to all his system components in the 6800 from the BASIC program." Tom Pittman writes as if he expects his readers to know what these are; now, the Homebrew club did have an early incident of software piracy, with 50 paper tape copies of Altair BASIC distributed, so he might have assumed they knew it from Altair BASIC, but not everyone had an 8080, so that seems a stretch.

What earlier usage, if any, is there of these functions in an implementation of BASIC or another language? Or were they a Microsoft invention?

20

Thanks to @another-dave, I went searching in DEC manuals. The decsystem10 Monitor Calls manual has PEEK ("return the contents of a specified exec address") and POKE ("alter the specified location in the monitor"). There is no USR function. While the manual was first printed in June 1971, I can only find a March 1976 revision.

Looking for an older edition, I came across "The PEEK function allows a privileged user to examine any word location in the monitor part of memory. The user program can examine words in the BASIC-PLUS run time system." RSTS/E System Manager's Guide "First printing, October 1974" And it has: "If the user desires a byte change, he must read the word (using the PEEK function), change the desired byte, and rewrite (using the POKE call) the entire word." No USR function.

So then I went searching monitor programs in general, and found PEEK ("used to get the contents of any absolute location in memory") in UUO Manual published in December 1973, definitely pre-Altair. There is no POKE command listed.

So PEEK and POKE predated Altair BASIC and made their way there through BASIC-PLUS.

| improve this answer | |
  • That's the SAIL UUO manual for what would later be retronymed the WAITS operating system. Did TOPS-10 have the PEEK UUO too? – Lars Brinkhoff Aug 14 at 9:01
  • 1
    Now it's mentioned, I recall PEEK/POKE UUOs on TOPS-10. My use was mid-1970s, versions 5.07 and 6.03 if the memory hasn't paged itself out. – another-dave Aug 14 at 14:51
  • 1
    Assuming PEEK/POKE originated on the -10; then it got to Altair Basic because Gates and Allen were TOPS-10 users; and it got to BASIC-PLUS on RSTS-11 because the authors of that OS were using TOPS-10 as a model. (As far as I recall from the fiche, syscalls were internally called UUOs, even though the mechanism is the definitely-implemented operation EMT) – another-dave Aug 14 at 23:10
  • 1
    CALLI 33 "PEEK" is on page 4-5 of this 1968 manual: bitsavers.org/pdf/dec/pdp10/Monitor/… – Lars Brinkhoff Aug 17 at 6:54
  • 1
    CALLI 114 "POKE" was apparently a later addition. See page 2-14 in this 1973 manual: bitsavers.org/pdf/dec/pdp10/TOPS10/… – Lars Brinkhoff Aug 17 at 7:55
11

According to the book Endless Loop: The History of the BASIC Programming Language by Mark Jones Lorenzo, they are indeed a Microsoft addition. Divergences in Altair BASIC from Dartmouth BASIC were listed in Appendix H of the Altair manual. Page 75 (emphasis mine):

Among the points mentioned [in Appendix H] are difference in array subscripts, [... more differences ...]; and PEEK (returning the value of a byte to the memory) and POKE (writing the value of a byte to the memory) for direct access to memory. (The POKE keyword would, later on, acquire nefarious uses, such as employing the command to alter the contents of memory addresses in order to facilitate game cheats in 8-bit processors; note that both PEEK and POKE did not exist before Gates and Allen.)

Note that the author is confusing two things here: the MITS Altair BASIC manual does indeed have an Appendix H on porting programs from other BASICs, but it doesn't mention PEEK and POKE. They're described in the main body of the manual.

| improve this answer | |
  • 1
    @supercat MS always used USR(), as a function is more versatile than a simple call. Additionally, one may even say USR() came before PEEK and POKE, as it's available with the 4k Version, while the later only come with the 8k Version – Raffzahn Aug 13 at 17:22
  • 4
    RSTS (DEC, PDP-11) had PEEK in the early 1970s, but I have not been able to pin down a date of introduction of this feature. – another-dave Aug 13 at 17:24
  • 1
    @supercat A) by putting up a routine there via monitor commads - keep in mind we talk a lower end Altair. B) That's what FACC (Floating Point Accumulator) is for. Works quite fine. And conversion functions have already back then been accessible trhu indirection, so both pretty independent. I suggest looking at MS manuals all the way from Altair to Dragon or MSX. – Raffzahn Aug 13 at 17:50
  • 2
    Thanks, Graham, I just ordered a copy of Endless Loop. Looks interesting! – Jeffrey Henning Aug 14 at 19:39
  • 1
    re note that both PEEK and POKE did not exist before Gates and Allen -- and both of those were acquainted with the PDP-10, which OS provided PEEK and POKE, as the answer from @JeffreyHenning shows. – another-dave Aug 14 at 23:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.