|
|
|
@ -1,13 +1,14 @@
|
|
|
|
|
#the closest thing to writing raw ASM
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
code = """LOL 01 010f
|
|
|
|
|
LOL 01 0113
|
|
|
|
|
LOL 01 0115
|
|
|
|
|
LOL 01 0117
|
|
|
|
|
LOL 00 0117
|
|
|
|
|
JML 0000
|
|
|
|
|
DBG"""
|
|
|
|
|
code = """#TESM INTERPRETER
|
|
|
|
|
LOL 06 0000 #program counter
|
|
|
|
|
LOL 01 0001 #put
|
|
|
|
|
LOL 02 0002 #vput
|
|
|
|
|
LOL 03 0003 #prnt
|
|
|
|
|
LOL 04 0004 #equl
|
|
|
|
|
LOL 05 0005 #vequl
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
out = """#include <stdint.h>
|
|
|
|
|
|
|
|
|
@ -75,8 +76,8 @@ for i in re.split("\n| ",code):
|
|
|
|
|
writeHex(f"0x{i[2]+i[3]}")
|
|
|
|
|
elif len(i) == 2:
|
|
|
|
|
writeHex(f"0x{i}")
|
|
|
|
|
else:
|
|
|
|
|
writeHex("0x00")
|
|
|
|
|
#else:
|
|
|
|
|
# writeHex("0x00")
|
|
|
|
|
count+=1
|
|
|
|
|
|
|
|
|
|
out = out.rstrip(", ")
|
|
|
|
|