diff --git a/src/dp32proto/dbg.json b/src/dp32proto/dbg.json new file mode 100644 index 0000000..7524509 --- /dev/null +++ b/src/dp32proto/dbg.json @@ -0,0 +1,98 @@ +{ + "labels": { + "_start": 0, + "_start_return": 9, + "f_fibo": 11, + "f_fibo_loop": 14, + "return": 27, + "result": 28, + "end": 29 + }, + "instructions": { + "0": { + "length": 1, + "srcline": 6 + }, + "1": { + "length": 1, + "srcline": 7 + }, + "2": { + "length": 2, + "srcline": 8 + }, + "4": { + "length": 2, + "srcline": 9 + }, + "6": { + "length": 2, + "srcline": 10 + }, + "8": { + "length": 1, + "srcline": 11 + }, + "9": { + "length": 2, + "srcline": 13 + }, + "11": { + "length": 1, + "srcline": 16 + }, + "12": { + "length": 1, + "srcline": 17 + }, + "13": { + "length": 1, + "srcline": 18 + }, + "14": { + "length": 1, + "srcline": 20 + }, + "15": { + "length": 1, + "srcline": 21 + }, + "16": { + "length": 1, + "srcline": 22 + }, + "17": { + "length": 1, + "srcline": 23 + }, + "18": { + "length": 1, + "srcline": 24 + }, + "19": { + "length": 2, + "srcline": 25 + }, + "21": { + "length": 2, + "srcline": 27 + }, + "23": { + "length": 2, + "srcline": 28 + }, + "25": { + "length": 2, + "srcline": 29 + }, + "27": { + "length": 1, + "srcline": 31 + }, + "28": { + "length": 1, + "srcline": 32 + } + }, + "src": "C:\\Users\\etdia\\code\\dp32-proto\\src\\test.dasm" +} \ No newline at end of file diff --git a/src/dp32proto/dbg_main.py b/src/dp32proto/dbg_main.py index c437d72..0c4d583 100644 --- a/src/dp32proto/dbg_main.py +++ b/src/dp32proto/dbg_main.py @@ -51,7 +51,7 @@ def main(): dbg_dict: DbgDict = parse_dbg(json.load(f)) dbg = Debugger(mem, dbg_dict) - with open (dbg_dict["src"], 'r') as f: + with open (dbg_dict["src"], 'r', encoding="utf8") as f: src = f.read() dbg_tui.run_tui(dbg, src) diff --git a/src/dp32proto/dpdebugger.py b/src/dp32proto/dpdebugger.py index 13c224d..184d3d7 100644 --- a/src/dp32proto/dpdebugger.py +++ b/src/dp32proto/dpdebugger.py @@ -55,7 +55,7 @@ class Debugger: } def __init__(self, mem: bytearray, dbg_dict: DbgDict): - with open(dbg_dict["src"], 'r') as f: + with open(dbg_dict["src"], 'r', encoding="utf8") as f: self._source_lines = f.readlines() self._vm = VM(mem) self._dbg_dict = dbg_dict