View Single Post
  #1   Spotlight this post!  
Unread 21-09-2004, 17:47
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,820
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Saving a variable in between runs.

Quote:
Originally Posted by Rickertsen2
you CAN write to ROM at runtime but its difficult and i wouldnt' advise it.
Yes. I'm guilty of posting the "accepted" techniques rather than what is potentially possible. I've done my experimenting with self-modifying code, but I don't believe it has a place on FIRST robots, so I advise against it as well.
The big issue isn't how to do the physical write, but how to avoid clobbering your code while doing so. Your code changes size and placement in memory every time you modify it. Even if you place the bytes to be modified at the high-end of memory there is no self protect mechanism that will prevent the linker from claiming that space for code on some future date. Just wait until you try executing your variables!
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle