•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FilePEEK(x)    DPEEK(x)    LPEEK(x)
POKE x,y   DPOKE x,y   LPOKE x,y
SPOKE x,y  SDPOKE x,y  SLPOKE x,y

x, y: iexp

With the functions xPEEK() one can read from specified memory locations.
With the functions xPOKE one can write to specified memory locations.

The individual variants are:

    PEEK(x)   Reads a byte from the address x.
    DPEEK(x)  Reads two bytes (word) staring at address x.
    LPEEK(x)  Reads four bytes (long) staring at address x.

    POKE x,y    Writes the value y as a byte to the address x.
    DPOKE x,y   Writes the value y as a 2-byte word to the address x.
    LPOKE x,y   Writes the value y as a 4-byte long to the address x.

It is important that when using DPEEK() and LPEEK(), only even
addresses are given.

The xPEEK() functions always work in supervisor mode.

xPOKE instructions have variants which work in the supervisor mode. So
protected addresses, e.g. 0 to 2047, can be modified. The appropriate
instructions are SPOKE, SDPOKE and SLPOKE. Caution is advised, particularly in
the supervisor mode, since modifications to protected addresses can have
serious consequences.

Example:

    LPOKE XBIOS(14,1)+6,0

--> Sets the head and tail pointers to the keyboard buffer to the buffer start,
    effectively erasing the buffer.

or alternately:

    REPEAT
    UNTIL INKEY$=""

--> Deletes the keyboard buffer, character by character.