Data Statement
TomS
Posts: 128
I want to store a large table in a program slot other than 0 and will access it using the STORE and READ statements. There doesn't seem to be a way to direct the DATA statement to anything other than program slot 0. Is there another way? I'm thinking I may have to write a small program that transfers data stored in program slot 0 to the other program slots. Which raises the question; does a program transfer after compile from computer to basic stamp only write to program slot 0?
Tom
Tom
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
Thanks
· ' {$STAMP BS2p, MyData.BSP}
In your main program you would use STORE 1 to point to slot 1 for use with READ and WRITE.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
READ addr,· variable.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
From the Help file:
· Syntax: STORE ProgramSlot
· Function
· Designate a program slot for the READ and WRITE instructions to operate upon.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 11/27/2005 3:19:48 PM GMT
What I ws trying to say was that I don't think you can read a DATA statement with the STORE command unless the DATA statement had been written by a STORE command.· I could be wrong.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Thanks for the answers. Now one more related question.
Let's say I've include the proper compiler directive and successfully stored the data in slot(s) 1- 7. If I now comment out the directive and re-compile the program, will it overwrite the slot with my table or will it remain intact?
Tom
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Great. Thanks Again
Tom
You didn't say which Stamp you have. The STORE command is only available on the BS2p, BS2pe and BS2px. If you have a BS2e or BS2sx, there are 8 banks available, but not the STORE command.
Think of the STORE command as a noun, not a verb. It is selecting which STORE (0 to 7) to patronize.
The compiler will leave untouched any program slot that is not referenced. So you if you take a reference to a slot out of the directive, whatever was there in the Stamp will stay there. Also, within a slot, you can tell the compiier to leave certain blocks of bytes alone. You might want to do that in order to store serial numbers or settings or accumulations.
DATA (16) ' skips over the block of eeprom from addresses 0 to 15 -- the compiler leaves them as they are in the Stamp
xtable DATA @128,(16) ' skips over the block or eeprom addresses from 128 to 143, referenced with label "xtable"
These have to be done in blocks of 16 bytes, on 16 byte boundaries within the eeprom.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Thanks