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!
=={{anchor|DPEEK|DPOKE|DEEK|DOKE}}16 and 32-bit versions== As most early [[home computer]]s used 8-bit processors, PEEK or POKE values are between 0 and 255. Setting or reading a 16-bit value on such machines requires two commands, such as {{code|2=basic|PEEK(A)+256*PEEK(A+1)}} to read a [[Endianness|little-endian]] 16-bit integer at address A, and {{code|2=basic|POKE A,V}} followed by {{code|2=basic|POKE A+1,V/256}} to store a 16-bit integer V at address A. Some BASICs, even on 8-bit machines, have commands for reading and writing 16-bit values from memory. [[BASIC XL]] for the [[Atari 8-bit computers]] uses a "D" (for "double") prefix: <code>DPEEK</code> and <code>DPOKE</code>. The East-German "Kleincomputer" KC85/1 and KC87 calls them <code>DEEK</code> and <code>DOKE</code>.<ref name="Kühnel_1987_Kleincomputer">{{cite book |editor-first1=Rainer |editor-last1=Erlekampf |editor-first2=Hans-Joachim |editor-last2=Mönk |author-first=Claus |author-last=Kühnel |pages=218, 232, 236 |title=Mikroelektronik in der Amateurpraxis |trans-title=Micro-electronics for the practical amateur |chapter=4. Kleincomputer - Eigenschaften und Möglichkeiten |trans-chapter=4. Microcomputer - Properties and possibilities |publisher={{ill|Militärverlag der Deutschen Demokratischen Republik|de}}, Leipzig |location=Berlin |date=1987 |orig-year=1986 |edition=1 |volume=3 |language=de |isbn=3-327-00357-2 |id=7469332}}</ref> The [[Sinclair QL]] has <code>PEEK_W</code> and <code>POKE_W</code> for 16-bit values and <code>PEEK_L</code> and <code>POKE_L</code> for 32-bit values. [[ST BASIC]] for the Atari ST uses the traditional names but allows defining 8/16/32 bit memory segments and addresses that determine the size. A Linux command line <code>peekpoke</code> <ref>peekpoke https://github.com/apritzel/peekpoke</ref> utility has been developed mainly for ARM based single board computers. <code>peekpoke</code> is a Linux command line tool to read from and write to system memory. Its main use is to talk to hardware peripherals from userland: to read or manipulate state, and to dump registers.
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)