beautypg.com

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

Page 24

background image

RPBASIC-52 PROGRAMMING GUIDE

2-5

BLOAD

Syntax:

B L O A D to RAM segmen t, RAM address, fro m EP ROM segmen t, EPRO M add ress, length
Where: to RAM segment = 0 to 7, is the 64K block in RA M to write to

RAM a ddress = 0 to 65,535, is the ad dress to write to
from EPROM segment = 0 to 7, is the 64K block in EPROM to read from
EPRO M address = 0 to 65,535, is the address in EPROM to read from
length = 0 to 6 5 ,5 3 5 , i s th e n um b e r o f by t es t o m o v e fr o m E PR O M t o R A M

Function:

T r an sf er s a b lo c k o f b in a ry d at a f ro m fl as h E P R OM t o R A M .

Mode:

C o m m a n d, R U N

Use:

BLOA D 1,0,5,0,1000

Cards:

RPC-320, RPC-330

D E S C R IP T I ON

BLO AD transfe rs a block of binary info rmation from EPRO M to R AM. B LOA D does no t check to see if
there is enough R AM m emory to sa ve to or if the EPR OM is la rge enough to p erform the transfe r. Data is
retrieved from RAM using PEEK type functions.

segment can be though of as the X0000H address of the RAM or EPROM. When a segment of 1 and an
address of 4300H are used, an address equivalent to 14300H is used to access the device. When a 128K
RA M or E PRO M is u sed, segment is 0 or 1. A 512K RAM or EPROM can have a segment of 0 to 7. A 32K
device only has segment 0.

NOTE: A v oi d u si ng R A M segment 0. This is where RPBASIC program and variables are used. When
segment 0 must be used, transfer data to above the MTOP address location.

Data transfer rate is about 23.5 m s/1000 bytes. D uring BLO AD tim e, ONT ICK and ONIT R interrupts are
recognized but not serviced. If these comma nds must be serviced quicker, transfer data in smaller blocks.

B S A V E t ra n sf er s d a ta fr om R A M to fl as h E P R OM .

RELATED

BSAVE , all PEEK commands

E R R O R

B A D A R G U M E N T When any parameter above is out of limits.

EXAMPLE

T h e fo l lo w i ng e x am p l e PO K E s d at a in t o s e g m en t 1 o f da t a R A M . T h e d a ta i s t h en s a ve d to E P R O M
segment 6 and loaded back to a different location in RAM. The data is then verified. A 128K RAM and
512K flash E PRO M m ust be in stalled for this e xam ple to w ork.

10 RA=512
20 FOR N=0 TO 1000 STEP 2
30 POKE W1,N,N
40 NEXT
50 FOR N=2000 TO 3000 STEP 2
60 POKE W1,N,0
70 NEXT
80 BSAVE6,RA,1,0,1000
90 BLOAD1,2000,6,RA,1002
100 FOR N=0 TO 1000 STEP 2

110 B=PEEKW(1,N+2000)

120 IF B<>N THEN PRINT "Error address",N," data is",B

130

NEXT