mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-06-28 09:36:01 -04:00
13 lines
314 B
Python
Executable file
13 lines
314 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
import fileinput
|
|
|
|
address = 0
|
|
|
|
|
|
for line in fileinput.input('-'):
|
|
# the 14- is to reverse the byte order to little endian
|
|
formatedLine = ' '.join(line[14-i:14-i+2] for i in range(0, len(line), 2))
|
|
sys.stdout.write(f'@{address:08x} {formatedLine:s}\n')
|
|
address+=8
|