FACTOID # 153: In all the countries surveyed, women do more housework than men.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > PEEK and POKE

In computing, PEEK is a BASIC programming language function used for reading the contents of a memory cell at a specified address. The corresponding command to set the contents of a memory cell is POKE. Originally, the word computing was synonymous with counting and calculating, and a science that deals with the original sense of computing mathematical calculations. ... BASIC is a family of high-level programming languages. ... In computer science, a memory address is a unique identifier for a memory location at which a CPU or other device can store a piece of data for later retrieval. ...

Contents


Statement syntax

The PEEK function and POKE command are usually invoked as follows, either in direct mode (entered and executed at the BASIC prompt) or in indirect mode (as part of a program): A command prompt (or just prompt) is a character or string of characters used in a command line interface to indicate that the computer is ready to accept typed input. ... This article needs to be cleaned up to conform to a higher standard of quality. ...

 integer_variable = PEEK(address) POKE address, value 

Note that address and value may stand for arbitrarily complex expressions*, as long as the evaluation of those expressions end up as valid memory addresses or values, respectively. A valid address in this context is an address within the computer's total address space or the CPUs addressing range, whichever is the smallest, while a valid value is (typically) an unsigned value between zero and the maximum unsigned number that the minimum addressable unit (memory cell) may hold.† An expression in a programming language is a combination of values and functions or procedures, interpreted according to the particular rules of precedence and of association for a particular programming language, which computes and then returns another value. ... In computing, an address space defines a context in which an address makes sense. ... This CPU uses numerous pins to connect to the motherboard. ...


Example: A typical early 1980s home computer could have 32 KB main memory and an 8-bit microprocessor CPU with a 16-bit address range, leading to the following restrictions on PEEK and POKE parameter values: The home computer is a consumer-friendly word for the second generation of microcomputers (the technical term that was previously used), entering the market in 1977 and becoming common during the 1980s. ... A kilobyte (derived from the SI prefix kilo-) is a unit of information or computer storage equal to either 1024 or 1000 bytes. ... Primary storage is a category of computer storage, often called main memory. ... 8-bit refers to the number of bits used in the data bus of a computer. ... In computer science, 16-bit is an adjective used to describe integers that are at most two bytes wide, or to describe CPU architectures based on registers, address buses, or data buses of that size. ...

 0 <= address <= 32767 ; comment: 32767 = 32K-1 = 2^15-1, i.e. smaller than the CPU's 16-bit address range ; from 0 to 65535 = 64K-1 = 2^16-1 0 <= value <= 255 ; comment: 255 = 2^8-1, i.e. the maximum value of an 8-bit byte 

(* A slightly complex-looking POKE-statement might look like this: POKERARRAY(42),PEEK(B1ADDR+(ASC(T9TXTS$))-VARRAY(42)) (where combinations of various BASIC functions and variables are used to build the parameters, and the interpreter allows space characters to be left out.) ) In computing, binary prefixes can be used to quantify large numbers where powers of two are more useful than powers of ten. ... In mathematics, a power of two is any of the nonnegative integer powers of the number two; in other words, two times itself a certain number of times. ... This article refers to the unit of binary information. ... An interpreter is a computer program that executes other programs. ... A space is a punctuation convention for providing interword separation in some scripts, including the Latin, Greek, Cyrillic, and Arabic. ...


(† Plain, straightforward limits on PEEK/POKE parameters—i.e., values restricted by address range/memory and word width—may for various reasons be amended by the BASIC interpreter/compiler designers, e.g. such as to allow for signed input values and/or outside address range/memory space address values; reasons for this could be e.g. to simplify certain operations by hiding unnecessary complexity from the BASIC programmer. In such a scheme, the PEEK and POKE machine code sequences within the interpreter/compiler must compute valid memory access parameters, of course.)


Memory cells and hardware registers

The address locations POKEd to or PEEKed from may refer either to ordinary memory cells or to memory-mapped hardware registers of I/O units or support chips such as sound chips and video graphics chips, or even to memory-mapped registers of the CPU itself (making possible the software implementation of powerful machine code monitors and debugging/simulation tools). An example of POKE-driven support chip control: the following POKE command, directed at a specific register of the Commodore 64's built-in VIC-II graphics chip, will make the screen border turn black: Memory-mapped O/I (MMIO) and port O/I (also called port-mapped O/I or PMIO) are two complementary methods of performing input/output between the CPU and O/I devices in a computer. ... In computing, a hardware register is a storage area for hardware I/O (input/output) of different kinds. ... This article is about the computer interface. ... A sound chip is an integrated circuit (i. ... In computer architecture, a processor register is a small amount of very fast computer memory used to speed the execution of computer programs by providing quick access to commonly used values—typically, the values being in the midst of a calculation at a given point in time. ... A machine code monitor (aka machine language monitor) is software built-into or separately available for various computers, allowing the user to enter commands to view and change memory locations on the machine, with options to load and save memory contents from/to secondary storage. ... Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware thus making it behave as expected. ... The Commodore 64 (C64, CBM 64) was a popular home computer of the 1980s. ... The VIC-II (Video Interface Chip II), specifically known as the MOS Technology 6567/8562/8564 (NTSC versions), 6569/8565/8566 (PAL), is the integrated circuit chip tasked with generating composite video graphics and DRAM refresh signals in the Commodore 64 and C128 home computers. ...

 POKE 53280, 0 

Different pre/non-PC computers usually differ as to the memory address areas designated for user programs, user data, operating system code and data, and memory-mapped hardware units. Because of all this, PEEK fuctions and POKE commands are inherently non-portable, meaning that a given sequence of those statements will almost never work on any other system than the one the program was written for. One of the first PCs from IBM - the IBM PC model 5150. ... In computer science, porting is the adaptation of a piece of software so that it will function in a different computing environment to that for which it was originally written. ...


Generic usage of "POKE"

"POKE" is sometimes used as a generic term to refer to any direct manipulation of the contents of memory, rather than just via BASIC, particularly among people who learned computing on the 8-bit microcomputers of the late 70s and early 80s. BASIC was often the only language available on those machines (on home computers, usually present in ROM), and therefore the obvious, and simplest, way to program in machine language was to use BASIC to POKE the opcode values into memory. Doing much low-level coding like this usually came from lack of access to an assembler. 8-bit refers to the number of bits used in the data bus of a computer. ... Apple IIc Generally, a microcomputer is a computer with a microprocessor (µP) as its CPU. Another general characteristic of these computers is that they occupy physically small amounts of space. ... The home computer is a consumer-friendly word for the second generation of microcomputers (the technical term that was previously used), entering the market in 1977 and becoming common during the 1980s. ... Rom is also the name of a toy and comic book character Rom (Spaceknight). ... A system of codes directly understandable by a computers CPU is termed this CPUs native or machine language. ... Microprocessors perform operations using binary bits (on/off/1or0). ... Assembly language or simply assembly is a human-readable notation for the machine language that a specific computer architecture uses. ...


See also


  Results from FactBites:
 
peek - definition by dict.die.net (440 words)
The results of "poke"s at these addresses may be highly useful, mildly amusing, useless but neat, or total lossage (see killer poke).
Since a real operating system provides useful, higher-level services for the tasks commonly performed with peeks and pokes on micros, and real languages tend not to encourage low-level memory groveling, a question like "How do I do a peek in C?" is diagnostic of the newbie.
The results of `poke's at these addresses may be highly useful, mildly amusing, useless but neat, or (most likely) total lossage (see killer poke).
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.