
RPBASIC-52 PROGRAMMING GUIDE
2-98
SAVE
Syntax: SAVE [segme nt]
Where: segment = 0 up to 7
Function: Save program to flash EPROM.
Mode: Comm and
Use: SAVE 1
Cards: All
DESCRIPTION
Use SAVE to store programs in flash EPROM. The current program in RAM is saved to the segment
specified. If no segment is specified, 0 is assumed. Up to 8 programs (totaling over 500K bytes) can be
saved, depending upon the flash EPROM type. Using EXECUTE, any of these 8 programs can be loaded and
run during run-time. Use LOAD to retrieve a program.
SAVE automatically determines the type of flash EPROM installed. When an attempt is made to save a
program to a segment larger than allowed by the EPROM type, an error message is returned.
The largest segment size depends upon the type of flash EPROM installed. The following table shows the
largest segment for a particular EPROM.
EPROM Size Sector Segment
type Bytes size range
29C256 32K 64 0
29C040 512K 512 0-7
SAVE completely overwrites previous data in m emory, up to the program size plus enough bytes to complete
a sector. A sector is the number of bytes programmed in a flash at a time. For example, if a program was
only 100 bytes long and a 29C 040 is installed, 412 bytes of "filler" are also programmed. If a program is
1000 bytes long, 24 bytes of filler are program med ( 2 sectors = 512 bytes). Sector sizes are not a c oncern
except to users of BSAVE command.
Maximum program size also depends upon the amount of RAM installed. A 32K RAM can run a 29K
program. A 128K or 512K RAM can execute up to a 60K byte program.
To find out the length of the progra m currently in RA M, type PRINT LEN in the im mediate m ode.
Frequently, the length of a program in RAM is 10% to 30% less than that in a disk file. This is because the
code is tokenized and com mands are replaced with a single character.
When program requirements are small and data is large, some data can be saved to the flash EPROM using
the BSAV E com man d.
RELATED
BSAVE, EXECUTE, LOAD
ERROR
BAD DATA If segment is > 7 or larger than flash EPROM type.
Komentáře k této Příručce