
RPBASIC-52 PROGRAMMING GUIDE
2-83
POKEB
Syntax: POKEB 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 255, number to save to RAM
Function: Writes one data byte to RAM.
Mode: Command, Run
Use: POK E B1,2100,D
Cards: All
DESCRIPTION
Use POKEB 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. Results are unpredicta ble. Poke into
memory above MTOP for safest operation.
PEEK and POK E state men ts and function s access me mory by specifying a segm ent and an address. A
segment is a 65,535 byte block. The largest segment number allowed depends upon the amount of RAM
installed. A system with 32K of RAM can only access 1 segment, numbered segme nt 0. When 128K is
installe d, two segm ents, 0 a nd 1, are accessible. A 512K system has 8 se gme nts, num bered 0 through 7.
Another way of looking at a seg ment is its address equiva lent. T he gen eral addressin g form is: S,A AA A. S
is the segme nt and AA AA is the address.
RPBASIC-52 always uses segment 0 for variable and program storage. Setting MTOP to a number below the
top of RAM ensures that RPBASIC-52 will not use the memory above that address. In a 32K RAM system,
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.
Maximum segment and address for a given system RAM size are:
RAM Maximum Maximum
Size Segment Address
32K 0 32767
128K 1 65535
512K 7 65535
RELATED
PEEKB, XBY
ERRORS
BAD SYNTAX If B, segment, ad dress, or data is missing.
BAD DATA If segment is > 7, address > 655 35 or negative , 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 segment 1, address 0
30 POKE $2,30,$(1) Pokes a string to segment 2, address 30.
Comentários a estes Manuais