beautypg.com

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

Page 102

background image

RPBASIC-52 PROGRAMMING GUIDE

2-83

POKEB

Syntax:

P O K E B segmen t,address,d ata
Where: segment = 0 to 7, specifies a 64K segment

address = 0 to 65535, specifies address in a segment
data
= 0 to 2 5 5, n um b e r t o sa v e to R A M

Function:

W r it es on e da ta b yt e t o R A M .

Mode:

Comm and, Run

Use:

POK E B1 ,2100,D

Cards:

All

D E S C R IP T I ON

Use POKE B to write to any one of 512K memory locations. The maximum number of
locations is limited by the amount of RAM installed.

WARNING:

RPBASIC-52 does not check the address . It is possible to poke into the
program, stack , or variable areas. Re sults are unpredicta ble. Poke into
memory above M TOP for safest operation.

PEE K and POK E state men ts and fu nction s acce ss me mory by spe cifying a segm ent an d an ad dress. A
s e g m en t is a 65 , 53 5 b yt e bl o ck . T he l ar g es t se g m e nt n um b e r a l lo w e d de p e nd s up o n th e a m ou n t o f R A M
installed. A system with 32K of RAM can only acc ess 1 segm ent, numbe red segme nt 0. When 128K is
installe d, two segm ents, 0 a nd 1, are acce ssible. A 512K system has 8 se gme nts, num bered 0 throu gh 7.
Ano ther w ay of lo oking at a seg men t is its ad dress e quiva lent. T he gen eral ad dressin g form is: S,A AA A. S
is the se gme nt and AA AA is the ad dress.

RPBAS IC-52 always uses segment 0 for variable and program storage. Setting MTOP to a number below the
t op o f R A M e ns u re s th a t R P B A SI C -5 2 wi ll no t u s e t he m e m or y a b ov e th a t a d dr e ss . I n a 3 2K R A M s ys te m ,
the top of memory is address 32767. In a 128K or larger system, it is 65535. In 128K or 512K systems, all of
the memory in segment 1 and higher is available for data storage.

M a x im u m segment and address for a given system RAM size are:

R A M

Maximum

Maximum

Size

Segment

Address

32K

0

32767

128K

1

65535

512K

7

65535

RELATED

P E E K B , X B Y

ERRORS

B A D S Y N T A X

If B, segment, ad dress, or data is missing.

BAD DATA

If segment is > 7, address > 655 35 or ne gative , data > 255 or negative.

EXAMPLES

10 POKE B0,64000,D

Pokes to segment 0, address 64000

20 POKE W1,0,A

Pokes a word (2 bytes) to segm ent 1, address 0

30 POKE $2,30,$(1)

Pokes a string to segment 2, address 30.