dsp-asm/test/bin-dump.py
Zack Buhman 118942521e test: add initial test makefile
This also adds support for "#" characters prior to immediates.

nop may also now appear in an op_t. The parser no longer generates nop_t--this
is instead now represented as an op_t with a zero-length ops vector.
2023-08-23 19:21:43 -07:00

13 lines
223 B
Python

import sys
import struct
with open(sys.argv[1], 'rb') as f:
b = f.read()
assert len(b) % 4 == 0, len(b)
for i in range(len(b) // 4):
word = b[i*4:i*4+4]
n, = struct.unpack('>I', word)
print(f'{n:>032b}')