git @ Cat's Eye Technologies SixtyPical / b470926
Check in test appliance (dcc6502-adapter) that was missed. Chris Pressey 3 years ago
3 changed file(s) with 25 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
00 *.pyc
1 vicerc
66 [Falderal]: http://catseye.tc/node/Falderal
77
88 -> 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"
1010
1111 -> Tests for functionality "Compile SixtyPical program"
1212
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))