Shop OBEX P1 Docs P2 Docs Learn Events
recovering code — Parallax Forums

recovering code

AntonuccioAntonuccio Posts: 17
edited 2013-02-09 21:17 in BASIC Stamp
Hello

I have a BS2 on a board of education and I have the latest version of basic stamp editor.


Is there a way to recover the code currently on my BS2 via Basic stamp editor while the BOE is hooked up to my PC?

I have writen many versions of the code currently on my BS2 and I cant remember wich is the most current. If I could recover the code from the BS2 it would be a great help





Comments

  • ercoerco Posts: 20,256
    edited 2013-02-07 19:32
    No. :(
  • Mike GreenMike Green Posts: 23,101
    edited 2013-02-07 20:10
    This question comes up every few months. The answer is no, you can't recover the code in the Basic Stamp's EEPROM. There are several reasons for this. First is that the only code in the EEPROM is compiled very compact interpretive code. There are no labels, no variable names stored in the EEPROM. Theoretically this interpretive code could be de-compiled into text, but many of the more complex statements would not be present. Things like DO / LOOP and CASE statements would appear as complex IF / THEN and GOTO statements with "made up" labels. The biggest problem is that, in order to read the program, another program has to be loaded into the Stamp and this will always overwrite part of the existing program. Practically speaking, you can't retrieve it.
  • garyggaryg Posts: 420
    edited 2013-02-07 20:45
    While it appears to be too late to figure out which revision is the current one.
    I have two suggestions that will maybe help you in the future.

    #1 - Look at the dates of the files you have saved.
    The last one or the one before the last one may the one you are looking for.

    #2 - In a different thread, someone had suggested to put a DEBUG statement containing the filename in the setup portion of
    your program.

    I started using the DEBUG labeling statements and it has saved me very much time in trying to determine which program is
    currently loaded.
    Occasionally, I will Still do some program changes and forget to update the DEBUG statement, but I'm getting better at it.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-02-07 20:49
    In the future, you can put a DEBUG statement in the initialization portion of your program that will identify the program and version as garyg and others have suggested. You can also use DATA statements to put identification information in the EEPROM at known (specific) locations that could be identified by another program loaded later (on top of the existing program).
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-02-09 20:32
    In the future, you can put a DEBUG statement in the initialization portion of your program

    Yes, I learned the hard way about this. I now use DEBUG in every program I write for future references. Once the Stamp is where it's intended to remain then it can be removed if it takes up needed memory. If not, I just leave it.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-02-09 21:17
    If all you need to do is determine which version from a known set of programs is loaded, this might help:

    http://forums.parallax.com/showthread.php/93047?p=639899&viewfull=1#post639899

    -Phil
Sign In or Register to comment.