Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Persistent memory default values

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
Don_Kirby



Joined: 15 Oct 2006
Posts: 329
Location: Long Island, New York

Posted: 29 April 2007, 11:50 AM    Post subject: Persistent memory default values Reply with quote

I'm assuming that the answer is 'undefined', but is there a default value for persistent memory variables on a factory fresh processor? Are all of the positions zeros? Or ones?

The reason I ask is as follows.

On the first run after a program download, I initialize all of my persistent variables (890 bytes of them). I would only like to do this one the first download though, and not on subsequent downloads, so using FirstTime() is out. I can roll my own FirstTime() manually, but want to be sure that the value I choose won't show up accidentally in memory. Granted, if I use anything other than a boolean (a Long set to a specific number for example) the chances are rare that it would just happen to be there already, but I'd like to make sure.

-Don
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 29 April 2007, 15:12 PM    Post subject: Re: Persistent memory default values Reply with quote

Don_Kirby wrote:
[I]s there a default value for persistent memory variables on a factory fresh processor? Are all of the positions zeros? Or ones?

I find nothing in the mega32/644 datasheets that specifies the initial value. My observation, however, has been that the bits are all ones.

Don_Kirby wrote:
I can roll my own FirstTime() manually, but want to be sure that the value I choose won't show up accidentally in memory.

It may be helpful to use a multi-byte indicator value such as &H55aa based on the theory that, whatever the default initial value, all bits will have the same value.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group