CALL PEEK
This page was last modified 13:45, 18 May 2020 by Mars2000you. Based on work by Gdx.

This instruction is available in DM-System2 Basic and Network Basic.

Contents

CALL PEEK in DM-System2 Basic

Effect

Reads the value from a byte of the memory (RAM or VRAM) and displays it or stores it in a variable.

Syntax

CALL PEEK ([@]<Address>,<Variable>)

The last parameter is optional. Parameters can not end with a comma alone.

Parameters

@ needs to be put before <address> to specify VRAM instead of RAM. Without this parameter, the value will be read from main RAM if the address is lower than 8000h.

<Address> is the address to read. To avoid error messages, decimal numbers need to be used for addresses higher than FFFFh (65535).

If <Address> is negative the binary complement is used. This means CALL PEEK(-1)=CALL PEEK(65536-1)=CALL PEEK(65535).

If you specify a RAM address higher than 65534, specifications of the mapped RAM are used.

65535 + (number of available segments) × 16384 is the upper limit. If you specify a value exceeding this value, you get an "Out of memory" error.

<Variable> is the variable in which you want to put the value read at this address. When not specified, the computer will display the value instead of store it in a variable.

Examples

CALL PEEK (&HC000)
192
CALL PEEK (&HC000,A):PRINT A
192
CALL PEEK (@&H2000)
244

Related to

CALL BLOCK, CALL PEEKS, CALL PEEKW, CALL POKE, CALL POKES, CALL POKEW

Compatibility

DM-System2 BASIC


CALL PEEK in Network Basic

Effect

Reads the value from a byte of the memory and stores it in a variable:

  • NetRAM only when the goal is your own computer (teacher or student)
  • RAM or NetRAM when the goal is the computer of a specific student (only available for the teacher)

The NetRAM is a special area of RAM mapped into the NetROM address space. Its size is 2048 bytes and it can be accessed on addresses 7800h to 7FFFh.

Syntax

CALL PEEK (<Variable>,<Address>,<StudentNumber>,<N>)

The two last parameters are optional. Parameters can not end with a comma alone.

Parameters

<Variable> is the variable in which you want to put the value read at the specified address.

<Address> is the address to read. It needs to be between 7800h and 7FFFh for the NetRAM.

<StudentNumber> is a number between 1 and 15. An error message is returned with value 0. Only the teacher can use this parameter.

N needs to be used to read an address in the NetRAM. It's only useful for the teacher.

Examples

CALL PEEK (A,&H7800): PRINT A
CALL PEEK (A,&HB000,1): PRINT A
CALL PEEK (A,&H7A00,5,N): PRINT A

Related to

CALL BRECEIVE, CALL BSEND, CALL POKE

Compatibility

Network BASIC