beautypg.com

Rpbasic-52 programming guide, Peekb – Remote Processing BASIC 52 User Manual

Page 97

background image

RPBASIC-52 PROGRAMMING GUIDE

2-78

PEEKB

Syntax:

P E E K B (segment,ad dress)
Where: segment = 0 to 7, specifies a 64K segment

address = 0 to 65535, byte address in a segment

Function:

R e a d s a b y te f ro m R A M

Mode:

Comm and, Run

Use:

A = P E E K B (1 , A D )

Cards:

All

D E S C R IP T I ON

T h i s f u nc t io n is u se d in c o nj u nc t io n w it h P OK E B . D at a is r et r ie v e d f r om a n y m em o r y l o ca t io n . P E E K B
inputs 1 byte of data. This function operates in much the sam e way as XB Y does except PE EKB c an access
5 1 2K o f R A M .

See POKEB command for addressing and segment info.

RELATED

POKEB

ERRORS

B A D S Y N T A X

If B, segment, or address is missing.

BAD DATA

If segment is > 7, or address > 65535

EXAMPLE

The following example reads digital I/O port A and saves it to RAM. The values are then retrieved and
printed back.

10 FOR N=0 TO 500
20 POKE B1,N*2,LINEB(3,0)
30 NEXT
40 FOR N=0 TO 500
50 A=PEEKB(1,N*2)
60 PRINT A,
70 NEXT