mirror of
https://git.k-space.ee/arti/vt1200.git
synced 2026-10-30 12:03:54 +02:00
29 lines
628 B
Python
29 lines
628 B
Python
#!/usr/bin/env python3
|
|
"""Dump unidasm lines for a BYTE-offset range (address = byte_offset*8).
|
|
|
|
Usage: ua.py START_OFF END_OFF
|
|
"""
|
|
import sys
|
|
|
|
PATH = "/tmp/opencode/v22.asm"
|
|
|
|
|
|
def main():
|
|
start = int(sys.argv[1], 0) * 8
|
|
end = int(sys.argv[2], 0) * 8
|
|
with open(PATH) as f:
|
|
for line in f:
|
|
head = line.split(":", 1)[0].strip()
|
|
if not head:
|
|
continue
|
|
try:
|
|
a = int(head, 16)
|
|
except ValueError:
|
|
continue
|
|
if start <= a < end:
|
|
print(line.rstrip("\n"))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|