![How to convert a file to hex and store it into another file](https://cdn2.cdnme.se/5447227/9-3/8_64e61dfb9606ee7f6adf5896.png)
Be aware that frequent re-writing can 'wear' the flash memory - don't do this daily. Note a major recoding is likely to force a lot of re-writing. In my case, BLOCKSIZE was 16 or 32 words (same as the write Blocksize for the code words) and K depended on how much expansion of the just-complete block I expected, usually 1 or 2. I put N words of all 1s between modules, setting N = K * BLOCKSIZE - currentAddress % BLOCKSIZE (K >= 1). The bin-diff program reported the count of changed words, so it was easy to tell if a lot was changed.
![how to convert a file to hex and store it into another file how to convert a file to hex and store it into another file](https://www.tipstricksisland.com/media/posts/203/responsive/cometdocs22-md-md.png)
You can call this a bootloader my mine was not used that way (initial writing was done with a programmer).To gain much from this approach, it's helpful to have empty space between modules so that the insertion of a single instruction doesn't change all words after the insertion. The code that does the changes must be itself not changed by the upgrade or bad juju will occur.
![how to convert a file to hex and store it into another file how to convert a file to hex and store it into another file](https://www.freeviewer.org/img/blog/ost-viewer-file-open.png)
A bin-diff program which emits a hex file corresponding to the differences.A 'hex2bin' equivalent which is run on the old and new hex files.Like 1and0, I developed my own which consisted of three components:
![How to convert a file to hex and store it into another file](https://cdn2.cdnme.se/5447227/9-3/8_64e61dfb9606ee7f6adf5896.png)