mirror of
https://github.com/jborza/emu6502.git
synced 2024-11-25 18:31:23 +00:00
23 lines
448 B
Python
23 lines
448 B
Python
|
import sys
|
||
|
|
||
|
output_name = sys.argv[1]
|
||
|
print(output_name)
|
||
|
|
||
|
f = open(output_name, 'wb')
|
||
|
|
||
|
def as_byte(value):
|
||
|
return bytes([value])
|
||
|
|
||
|
def process_line(line):
|
||
|
hexes = line[5:].strip()
|
||
|
hex_values = [int(hex,16) for hex in hexes.split(' ')]
|
||
|
for hex_value in hex_values:
|
||
|
print(as_byte(hex_value))
|
||
|
f.write(as_byte(hex_value))
|
||
|
#print(chr(hex_value), end = '')
|
||
|
|
||
|
for line in sys.stdin:
|
||
|
process_line(line)
|
||
|
|
||
|
f.close()
|