146
CipherLab BASIC Programming Part I
FLASH_READ$
Purpose To read a data string from the memory bank 0xF60000 ~ 0xF6FFFF.
Syntax A$ = FLASH_READ$(N%)
Remarks “A$” is a string variable to be assigned to the result.
“N%
” is an integer variable in the range of 1 to 256, indicating the ordinal
number of the record.
Example
FLASH_WRITE
Purpose To write a data string to the memory bank 0xF60000 ~ 0xF6FFFF.
Syntax A% = FLASH_WRITE(N%, A$)
Remarks “A%” is an integer variable to be assigned to the result.
1
-1
-2
-3
-4
Write flash memory successfully.
The BASIC program is too large; no free flash memory available.
Error command for erasing the flash memory.
The given index is out of the range.
Fail to write (probably flash memory is not erased yet or something
goes wrong).
“N%” is an integer variable in the range of 1 to 256, indic
number of the record.
“A$” is a string variable, representing the data string to be saved.
Before writing data to any used record, it is necessary to use the following
command to erase the memory bank first:
err% = FLASH_WRITE(0, “ERASE”)
Note that the record number must be 0, and the string must be “ERASE”.
After erasing the whole memory bank, you can then write data to it by one
record at a time. Be aware that whenever you need to write data to any used
record, the whole memory bank nee
ds to be erased; otherwise, this command
will fail.
Example
err% = FLASH_WRITE(1, “data number#1”)
…
err% = FLASH_WRITE(256, “data number#256”)
ROM_SIZE
Purpose To get the size of the whole flash memory in kilobytes.
Syntax A% = ROM_SIZE
Remarks “A%” is an integer variable to be assigned to the result.
Example
PRINT “Flash size = ”, ROM_SIZE
See Also MEMORY_INFORMATION(4)