mirror of
https://git.k-space.ee/arti/vt1200.git
synced 2026-10-31 12:05:05 +02:00
15 lines
488 B
Python
15 lines
488 B
Python
#!/usr/bin/env python3
|
|
"""Dump dis34 lines in [start,end) byte offsets from the gz disassembly."""
|
|
import gzip, re, sys
|
|
path = "reference/dis34-a-v22.txt.gz"
|
|
start = int(sys.argv[1], 0); end = int(sys.argv[2], 0)
|
|
cur = None
|
|
with gzip.open(path, "rt", errors="replace") as f:
|
|
for line in f:
|
|
m = re.match(r"^([0-9a-fA-F]{8}):", line)
|
|
if m:
|
|
a = int(m.group(1), 16)
|
|
if a < start or a >= end:
|
|
continue
|
|
sys.stdout.write(line)
|