A SERVICE OF

logo

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 POKEB1,30*NO, JC
1010 POKEW1,30*NO+ 1,AC
1020 POKEF1,30*NO+ 3,CF
1030 POKE$1, 30*NO+ 9,$(0)
1040 RETURN
Subroutine 2000 - 2040 retrieves data into variables CF,
JC and AC.
2000 JC = PEEKB(1,30*NO)
2010 AC = PEEKW (1,30*NO+ 1)
2020 $(1) = PEEK$(1, 30*NO+ 9)
2030 CF = PEEKF (1,30*NO+ 3)
2040 RETURN
You can store and retrieve strings and variables in this
way. There are many variations of PEEK and POKE
statements. Refer to the RPBASIC-52 Software
Supplement in this manual for additional information and
examples. A list of comm ands appears at the end of this
chapter.
BLOCK DATA TRANSFER
Blocks of data are transferred to and from RAM and
flash EPROM using BLOAD and BSAVE commands.
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 EPROM to RAM, using BLOAD, take
approximately 23.5 ms/1000 bytes. Transfers from
RAM to EPROM , using BSAVE, are even longer at 100
ms/1000 bytes using a 512K byte EPROM. T his time is
even longer when smaller EPROM s are used (due to the
programming algorithm).
Serial port, tick timer, and external interrupts are
enabled dur ing these transfers. Howe ver, responses to
ONT ICK or ONITR are delayed by the time it takes to
transfer data. When ONTIC K or ONITR must be
serviced faster, transfer data in smaller blocks.
Refer to BLOAD and BSAVE in Appendix A for more
information.
ASSEMBLY LANGUAGE INTERFACE
Assembly language programs must be placed in the
RPBASIC-52 EPROM . When using RPBASIC-52,
programs should start at addr ess 6000H or higher up to
7FFFH.
RPBASIC is norm ally in a 32K byte EPROM (27C256).
A 64K byte EPROM (27C512) may be used in socket U4
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. Pin 1 is designated by
the square pad.) Solder a jumper between W11 pin 2
and 3.
Docum ented assembly 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 board 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
with RAM.
Command Function
BLOAD Transfers data from EPROM to RAM
BSAVE Transfers data from RAM to EPROM
CALL Calls an assembly language routine
CBY Returns code memor y data
DBY Returns or assigns internal memory
MTOP Sets top of RAM memory
PEEK B Returns a byte
PEEK F Returns a floating point number
PEEK W Returns a 16 bit value
PEEK $ Returns a string
POKE B Stores a byte
POKE F Stores a floating point number
POKE W Stores a 16 bit value
POKE $ Stores a string
XBY Returns or assigns external memory