diff options
| author | s-ol <s+removethis@s-ol.nu> | 2021-07-06 10:03:57 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2021-07-06 10:04:36 +0000 |
| commit | 912b5df8aef99aa00848d2a87bb5e5cebc7ff6b2 (patch) | |
| tree | 3c62b2a7db782bd6c142a2fdb37d232f31f16eb1 /pack.py | |
| parent | update ex.subv to work with new pipeline (diff) | |
| download | subv-912b5df8aef99aa00848d2a87bb5e5cebc7ff6b2.tar.gz subv-912b5df8aef99aa00848d2a87bb5e5cebc7ff6b2.zip | |
fix and finish new pipeline
Diffstat (limited to 'pack.py')
| -rwxr-xr-x | pack.py | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -69,13 +69,9 @@ def pack(iter): buf = bits.empty def flush_bytes(): - tmp = out[:] + line = " ".join("{:02x}".format(b.val) for b in out) out.clear() - return { - "type": "instr", - "instr": tmp, - "comment": None, - } + return line last_segment = None for segment, line in iter: @@ -93,15 +89,18 @@ def pack(iter): while buf.size >= 8: byte = buf[7:0] buf = buf.slice_allowempty(slice(buf.size - 1, 8)) - out.append((byte.val,)) + out.append(byte) if len(out) == 4: - yield subv.format(flush_bytes()) + yield flush_bytes() last_segment = segment assert buf.size == 0, "segment '{}' end isn't byte-aligned".format(segment) + if len(out) > 0: + yield flush_bytes() + if __name__ == "__main__": import sys |
