Check in test appliance (dcc6502-adapter) that was missed.
Chris Pressey
4 years ago
6 | 6 |
[Falderal]: http://catseye.tc/node/Falderal
|
7 | 7 |
|
8 | 8 |
-> Functionality "Compile SixtyPical program" is implemented by
|
9 | |
-> shell command "bin/sixtypical --basic-prelude --compile %(test-body-file) | bin/dcc6502-adapter"
|
|
9 |
-> shell command "bin/sixtypical --basic-prelude --compile %(test-body-file) | tests/appliances/bin/dcc6502-adapter"
|
10 | 10 |
|
11 | 11 |
-> Tests for functionality "Compile SixtyPical program"
|
12 | 12 |
|
|
0 |
#!/usr/bin/env python
|
|
1 |
|
|
2 |
# script that allows the binary output of sixtypical --basic-prelude --compile to be
|
|
3 |
# disassembled by https://github.com/tcarmelveilleux/dcc6502
|
|
4 |
|
|
5 |
import sys
|
|
6 |
import re
|
|
7 |
from subprocess import check_output
|
|
8 |
from tempfile import NamedTemporaryFile
|
|
9 |
|
|
10 |
bytes = sys.stdin.read()
|
|
11 |
|
|
12 |
bytes = bytes[14:]
|
|
13 |
|
|
14 |
f = NamedTemporaryFile(delete=False)
|
|
15 |
filename = f.name
|
|
16 |
f.write(bytes)
|
|
17 |
f.close()
|
|
18 |
|
|
19 |
lines = [line for line in check_output("dcc6502 -o 2061 {}".format(filename), shell=True).split('\n') if line and not line.startswith(';')]
|
|
20 |
lines = [re.sub(r'\s*\;.*$', '', line) for line in lines]
|
|
21 |
lines.pop()
|
|
22 |
sys.stdout.write('\n'.join(lines))
|