mirror of
https://github.com/catseye/SixtyPical.git
synced 2024-11-25 07:32:16 +00:00
Check in test appliance (dcc6502-adapter) that was missed.
This commit is contained in:
parent
2216fcec17
commit
b4709268bc
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
|
vicerc
|
||||||
|
@ -7,7 +7,7 @@ SixtyPical to 6502 machine code.
|
|||||||
[Falderal]: http://catseye.tc/node/Falderal
|
[Falderal]: http://catseye.tc/node/Falderal
|
||||||
|
|
||||||
-> Functionality "Compile SixtyPical program" is implemented by
|
-> Functionality "Compile SixtyPical program" is implemented by
|
||||||
-> shell command "bin/sixtypical --basic-prelude --compile %(test-body-file) | bin/dcc6502-adapter"
|
-> shell command "bin/sixtypical --basic-prelude --compile %(test-body-file) | tests/appliances/bin/dcc6502-adapter"
|
||||||
|
|
||||||
-> Tests for functionality "Compile SixtyPical program"
|
-> Tests for functionality "Compile SixtyPical program"
|
||||||
|
|
||||||
|
23
tests/appliances/bin/dcc6502-adapter
Executable file
23
tests/appliances/bin/dcc6502-adapter
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
# script that allows the binary output of sixtypical --basic-prelude --compile to be
|
||||||
|
# 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))
|
Loading…
Reference in New Issue
Block a user