
RPBASIC-52 PROGRAMMING GUIDE
2-78
PEEKB
Syntax: PEEKB(segment,ad dress)
Where: segment = 0 to 7, specifies a 64K segment
address = 0 to 65535, byte address in a segment
Function: Reads a byte from RAM
Mode: Command, Run
Use: A = PEEKB(1,AD)
Cards: All
DESCRIPTION
This function is used in conjunction with POKEB. Data is retrieved from any memory location. PEEKB
inputs 1 byte of data. This function operates in much the same way as XB Y does except PE EKB can access
512K of RAM.
See POKEB command for addressing and segment info.
RELATED
POKEB
ERRORS
BAD SYNTAX 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
Comentarios a estos manuales