
RAM MEMORY
SECTION 5
Page 5-3 RPC -320
510 GOSUB 2000
Retrieve variables
This subroutine stores variables CF, JC, and AC into an
array starting in segment 1, address 0.
1000 POK EB1, 30*NO, JC
1010 POKEW1,30*NO+ 1,AC
1 0 20 P O KE F 1 , 3 0* N O + 3 , C F
1030 POKE$1, 30*NO+ 9,$(0)
1040 RETURN
S u br o ut in e 20 0 0 - 20 4 0 r e tr i ev e s d a ta in to v ar i ab le s C F ,
J C a nd A C .
2000 JC = PEEKB(1,30*NO)
2010 AC = PEEKW (1,30*N O+ 1)
2020 $(1) = PEEK$(1, 30*NO+ 9)
2030 CF = PEEKF (1,30*N O+ 3)
2040 RETURN
You can store and retrie ve strings a nd variab les in this
way. Ther e are many variations of PEEK and POKE
statements. Refer to the RPBASIC-52 Software
Supplement in this manual for additional information and
examp les. A list of comm ands appea rs at the end of this
chapter.
BLOCK DATA TRANSFER
Blocks of data are transferred to and from RA M and
flash EPR OM u sing BLOAD and BSAVE comma nds.
Block transfers are useful for loading and storing data,
look-up tables, text, etc. U p to 65,535 bytes can be
moved from RAM to EPROM or EPROM to RAM at
one time. The absolute number of bytes that are moved
is limited by the RAM and EPR OM sizes.
Transfers from EPRO M to RAM , using BLOA D, take
approximately 23.5 m s/1000 bytes. T ransfers from
RAM to EPROM , using BSAVE , are even longer at 100
ms/ 1000 bytes usin g a 512K byte EPR OM . T his time is
even longer when smaller E PROM s are used (due to the
program ming algorithm).
Serial port, tick timer, and external interrupts are
enabled dur ing these tra nsfers. Howe ver, response s to
ONT ICK or ONIT R are d elayed by the time it takes to
transfer data. W hen ONTIC K or ONIT R must be
serviced faster, transfer data in sm aller blocks.
Refer to BLOAD and BSAVE in
Appendix A
for more
information.
ASSEMBLY LANGUAGE INTERFACE
Assembly language program s must be placed in the
RPBASIC-52 E PROM . W hen using RPBASIC-52,
progr ams shou ld start at addr ess 6000H or higher up to
7 F F F H .
RPBASIC is norm ally in a 32K byte EPROM (27C256).
A 6 4K b yt e E P R O M ( 27 C 5 12 ) m ay b e u s ed in s oc k et U 4
provided the following modification is made: Cut the
trace between W11 pins 1 and 2 on the circuit side.
(Jumper W11 is under socket U4. P in 1 is designated by
the square pad.) Solder a jumpe r between W11 pin 2
and 3.
Docum ented assem bly language interface calls listed in
the Intel
MCS BASIC -52 Users Manual
will not work
with RPBASIC-52. This is because RPBASIC-52 has
been reassembled and code shifted around.
The RP-10 adapter boar d is used to run and debug
assembly and C code. This board plugs into RAM
socket U5 and RPBASIC socket U4. It does not use the
Basic at all.
COMMANDS
The following is a list of RPBASIC-52 commands used
w it h R A M .
Comm and
Function
BLOAD
Transfers data from EPROM to RAM
BSAVE
Transfers data from RAM to EPROM
CALL
Calls an assembly language routine
CBY
Return s code m emor y data
DBY
Returns or assigns internal memory
MTOP
Sets top of RAM memory
PEEK B
Return s a byte
PEEK F
Returns a floating point number
PEEK W
Returns a 16 bit value
PEEK $
Returns a string
POKE B
Stores a by te
POKE F
Stores a floating point number
POKE W
Stores a 16 bit value
POKE $
Stores a string
XBY
Returns or assigns external memory