View unanswered posts | View active topics It is currently Sun Mar 29, 2020 6:20 am

Reply to topic  [ 5 posts ] 
 Splitting & Combining ROM images 
Author Message
User avatar

Joined: Sat Aug 10, 2019 1:13 am
Posts: 1
It surprises me how little information there is online about how to split ROM images into their LO & HI bytes.
Typically with buses 16-bits and wider, multiple 8-bit ROMs are used to cover the entire width of the bus; thus requiring the firmware binary to be split into parts.
The command line tool srec_cat can be used to do what we need:
srec_cat -o LOW.bin -binary ROM.bin -binary -split 2 0
srec_cat -o HIGH.bin -binary ROM.bin -binary -split 2 0

Bonus example: Combining the LO & HI ROM dumps back into a flat binary:
srec_cat -o ROM.bin -binary LOW.bin -binary -unsplit 2 0 HIGH.bin -binary -unsplit 2 1

For a more in depth explanation, see my site entry on the topic.

Sat Feb 22, 2020 11:25 am
Profile WWW

Joined: Tue Dec 11, 2012 8:03 am
Posts: 279
Location: California
I've used that tool at It was a lifesaver.

_________________ lots of 6502 resources

Sat Feb 22, 2020 7:09 pm
Profile WWW

Joined: Sat Feb 02, 2013 9:40 am
Posts: 1105
Location: Canada
I wrote my own tool a while ago called "split.exe" that as tested now doesn't work in 64-bit Windows. Time to upgrade it. I suspect others have found their own means to split files.
I've also a tool called "RAMBBuster" to convert a binary file into a series of "INST_xxx" definitions for an FPGA constraints file. It can swap the byte order around in the process.
Useful for setting initial block ram contents.

Robert Finch

Sun Feb 23, 2020 3:08 am
Profile WWW

Joined: Sat Feb 02, 2013 9:40 am
Posts: 1105
Location: Canada
Updated split to Windows 64-bit and placed the source code in GitHub under the software/split folder.
split will split a file into up to eight different output binaries.

split - binary file splitting utility.
2009-2020  Robert Finch
split <filename> <option>
        Splits an input file into up to eight output files.
        <option> has two parts - a character code b,h,w,d and the number of
        output streams
        the character code indicates the output stream (file) width
        (b=byte,h=halfword (16 bits),w=word(32 bits),d=double word (64 bits)
        Example: split test.bin w4
                will treat test.bin as a series of word (32 bit) values
                and split the test.bin file into four output files (test.o0, test.o1, ...)
                from the input file.
        Input file name default extension is '.bin'.

Robert Finch

Sun Feb 23, 2020 4:13 am
Profile WWW

Joined: Mon Oct 07, 2019 2:41 am
Posts: 85
Splitting by nibbles (4 bits) might be usefull, if one had to update a machine using really old proms
say for microcode.

Mon Feb 24, 2020 6:10 pm
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software