| Electronics > Projects, Designs, and Technical Stuff |
| Swapping bits in bytes in a file |
| (1/2) > >> |
| Alex Eisenhut:
I am working on an old Commodore compatible floppy drive. The manufacturer swapped data bits around on the motherboard so that Commodore ROMs don't work directly. Is there a utility or something that can read in a binary file, swap two bits around and output the swapped byte into a new file? Worst case I guess I can do it in Excel if I can get ASCII hex data. |
| BrianHG:
This editor has some pretty bit manipulation capabilities: https://www.hhdsoftware.com/free-hex-editor Though I see reverse bits and rotate left and right, cycling through a pattern of these 3 may allow you to achieve the correct bit swapping you require. |
| NiHaoMike:
It would be trivial to program in Python. Learn how to (make sure the guide you use is Python 3, since Python 2 is obsolete) and you'll wonder why you didn't start learning it earlier. |
| Benta:
Wouldn't it be easier to swap the two lines to the ROM on the PCB? (cut 'n jumper). |
| amyk:
It's around a dozen lines of C... if you specify how you want the bits to be swapped I can probably write it for you in a few minutes. |
| Navigation |
| Message Index |
| Next page |