SPIN DBase, PBase, and DBase
Kye
Posts: 2,200
I'm writing some code that loads program files to eeprom. For EEPROM spin files my code works file. However, for BINARY spin files I have some problems because the files do not cause my loader program to update all eeprom sections with the new image leaving some sections with old data.
I'm okay with this behavior of my loader, however, I would like to force non-valid sections to be zeros when I read them into memory by looking at the setup pbase, dbase, and vbase variables to zero the variable image and the stack area.
Is this possible and how do I do it?
I'm okay with this behavior of my loader, however, I would like to force non-valid sections to be zeros when I read them into memory by looking at the setup pbase, dbase, and vbase variables to zero the variable image and the stack area.
Is this possible and how do I do it?
Comments
-Phil
EDIT: Programs should not assume that the stack area has been zeroed, but they can assume that the var area is initialized to zero. However, there may be programs around that assume that the high end of the stack is initialized to zero, since this is the case in EEPROM images. Therefore, it would be safer to zero out everything after vbase, and patch in the 4 words before dbase.
The remainder of the .eeprom file is filled with zeroes. The only additional consideration required for the checksum is the effect of the FFFF_F9FF_FFFF_F9FF. [Looking at some loader code that I wrote awhile back, it looks like the two additional longs are already figured into the .binary file's checksum, even though they're missing from the file itself.]
-Phil