Shop OBEX P1 Docs P2 Docs Learn Events
OBJect Files — Parallax Forums

OBJect Files

Oxalium7Oxalium7 Posts: 5
edited 2007-10-15 20:27 in BASIC Stamp
Is there a document available that gives a detailed description of the format of the BASIC Stamp OBJ files? I can determine some of its format by looking at the file using a HEX Editor.

Is the checksum that is displayed when downloading to a Stamp really a checksum? Some people use checksum and CRC interchangeably.

From the numbers displayed it appears to be a 32-bit "checksum". Is that correct?

How is the "checksum" generated? Over what data contained in the OBJ file does the checksum get generated?

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-10-13 19:02
    I believe an object file is a copy of the memory map which is a tokenized version of the Pbasic program. Tracy Allen has a very good description of how the checksum is derived and how data is downloaded to a Stamp at this link http://www.emesys.com/BS2clone.htm



    Jeff T.
  • Oxalium7Oxalium7 Posts: 5
    edited 2007-10-15 20:27
    The object file (built using the Generate Object Code... action from the BASIC Stamp Editor menu) is not just a copy of the memory map. The memory map does not include the block address (one byte) that precedes each 16-byte block nor does it include the one-byte checksum (2's complement sum) that follows each 16-byte block. Also, a hex editor will reveal that there is some padding that occurs after each slot's contents. Before each slot's contents there is a block count. Quite often seen after the "real" blocks are "garbage" blocks. Is it possible that the Editor does not clear the slot build area before it assembles the new contents?

    The checksum Tracy includes in that BS2clone document is the block checksum over a single 16-byte block. There is no description of the "checksum" that gets reported in the dialog box before one downloads a Stamp using the OBJect file and the StampLoader or a standalone executable.

    The OBJect file also contains a "header". Some of in this "header" information gets display in the "Parallax, Inc. - BASIC Stamp Loader v2.7" dialog box: Product, Firmware, Checksum, Compile Date and Notes.

    I had attempted to contact Brian Forbes to find out if his Inside Stamp II book contained the information I sought. I have not received a reply to my email. I also noticed that though Brian's website is still accessible, it appears that no updates have been made to it since 2005.

    The reason that I'm asking these questions is that I am attempting to reconstruct a damaged OBJect file. This file contained the object code for seven slots. I have source for some of the slots. That's my main problem - I only have source code for some of the slots. I even have the captured contents from a Stache, which is no longer working for some reason. I have gotten quite far at reconstructing the OBJect file piecing together the object code generated from the source files and the object code captured from the Stache. However, without generating the proper "checksum", the StampLoader will complain and not download the file.

    At some point, I will attempt to recreate the missing source code. I just figured that I had all the parts I needed to quickly reconstruct an object file and postpone the attempt to recreate the missing source code.
Sign In or Register to comment.