Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PEEK and POKE
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Commands in some high-level programming languages}} {{for|the White Town album|Peek & Poke (album)}} {{refimprove|date=October 2015}} [[File:Monitor Commodore CBM 3016 with BASIC program-0309.jpg|thumb|PEEK and POKE in line 100 of a [[Commodore BASIC|Commodore Basic]] program on a [[CBM 3016]]]] In [[computing]], '''PEEK and POKE''' are commands used in some [[high-level programming language]]s for accessing the contents of a specific [[Memory cell (computing)|memory cell]] referenced by its [[memory address]]. PEEK gets the byte located at the specified memory address.<ref name="PEEK">{{cite web|url = http://www.qbasicnews.com/qboho/qckpeek.shtml|title = PEEK|work = Microsoft QuickBasic 4.5 Advisor|access-date = 2007-12-28|year = 1990|publisher = Microsoft|archive-url = https://web.archive.org/web/20110516170043/http://www.qbasicnews.com/qboho/qckpeek.shtml|archive-date = 2011-05-16|url-status = dead}}</ref> POKE sets the memory byte at the specified address.<ref name="POKE">{{cite web|url = http://www.qbasicnews.com/qboho/qckpoke.shtml|title = POKE|work = Microsoft QuickBasic 4.5 Advisor|access-date = 2007-12-28|year = 1990|publisher = Microsoft|archive-url = https://web.archive.org/web/20110516170056/http://www.qbasicnews.com/qboho/qckpoke.shtml|archive-date = 2011-05-16|url-status = dead}}</ref> These commands originated with [[machine code monitor]]s such as the [[PDP-10|DECsystem-10]] monitor;<ref>{{cite web|url=https://retrocomputing.stackexchange.com/questions/15872/what-is-the-oldest-reference-to-peek-poke-and-usr|title=What is the oldest reference to PEEK, POKE, and USR?|access-date=15 August 2020|archive-date=14 August 2020|archive-url=https://web.archive.org/web/20200814233608/https://retrocomputing.stackexchange.com/questions/15872/what-is-the-oldest-reference-to-peek-poke-and-usr|url-status=live}}</ref> these commands are particularly associated with the [[BASIC]] programming language, though some other languages such as [[Pascal (programming language)|Pascal]] and [[COMAL (programming language)|COMAL]] also have these commands. These commands are comparable in their roles to [[Pointer (computer programming)|pointers]] in the [[C (programming language)|C language]] and some other programming languages. One of the earliest references to these commands in BASIC, if not the earliest, is in [[Altair BASIC]].<ref>[https://archive.org/stream/bitsavers_mitsMITSAl_6669937/MITS_AltairBASIC_1975#page/n3/mode/1up Altair 8800 BASIC Reference_Manual 1975], Page 68 of PDF</ref> The PEEK and POKE commands were conceived in early personal computing systems to serve a variety of purposes, especially for modifying special [[memory-mapped I/O|memory-mapped]] [[hardware register]]s to control particular functions of the computer such as the input/output peripherals. Alternatively programmers might use these commands to copy software or even to circumvent the intent of a particular piece of software (e.g. manipulate a game program to allow the user to cheat). Today it is unusual to control computer memory at such a low level using a high-level language like BASIC. As such the notions of ''PEEK'' and ''POKE'' commands are generally seen as antiquated. The terms ''peek'' and ''poke'' are sometimes used colloquially in computer programming to refer to memory access in general.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)