2017-12-11 13:46:06 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2018-03-06 17:00:39 +00:00
|
|
|
# script that allows the binary output of sixtypical --prelude=c64 --compile to be
|
2017-12-11 13:46:06 +00:00
|
|
|
# disassembled by https://github.com/tcarmelveilleux/dcc6502
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import re
|
|
|
|
from subprocess import check_output
|
|
|
|
from tempfile import NamedTemporaryFile
|
|
|
|
|
|
|
|
bytes = sys.stdin.read()
|
|
|
|
|
|
|
|
bytes = bytes[14:]
|
|
|
|
|
|
|
|
f = NamedTemporaryFile(delete=False)
|
|
|
|
filename = f.name
|
|
|
|
f.write(bytes)
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
lines = [line for line in check_output("dcc6502 -o 2061 {}".format(filename), shell=True).split('\n') if line and not line.startswith(';')]
|
|
|
|
lines = [re.sub(r'\s*\;.*$', '', line) for line in lines]
|
|
|
|
lines.pop()
|
|
|
|
sys.stdout.write('\n'.join(lines))
|