diff options
Diffstat (limited to 'salis.py')
| -rwxr-xr-x | salis.py | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -175,9 +175,9 @@ logger_dll = ctypes.CDLL(logger_shared.binfile) # Pull in logging functions from C # This way there's just a single logging system to care about log = SimpleNamespace() -log.trace = lambda msg: logger_dll.log_trace(msg.encode()) -log.info = lambda msg: logger_dll.log_info(msg.encode()) -log.attention = lambda msg: logger_dll.log_attention(msg.encode()) +log.trace = lambda msg: logger_dll.log_trace_to_stdout(msg.encode()) +log.info = lambda msg: logger_dll.log_info_to_stdout(msg.encode()) +log.attention = lambda msg: logger_dll.log_attention_to_stdout(msg.encode()) logger_shared.log(log) # ------------------------------------------------------------------------------ @@ -263,12 +263,11 @@ if args.command == "load": # [section] load instruction set # ------------------------------------------------------------------------------ arch_inst_path = f"arch/{args.vm_arch}/arch_inst.c" -arch_build = Build(arch_inst_path, is_library=True) +arch_build = Build(arch_inst_path, is_library=True, flags=["-Icore"]) arch_build.build() arch_build.log(log) arch_dll = ctypes.CDLL(arch_build.binfile) -arch_dll.arch_inst_cap.restype = ctypes.c_int arch_dll.arch_inst_mnemonic.argtypes = [ctypes.c_uint8] arch_dll.arch_inst_mnemonic.restype = ctypes.c_char_p @@ -286,8 +285,8 @@ with open(anc_path, "r") as f: lines = filter(lambda line: line and not line.startswith(";") and not line.isspace(), lines) lines = map(lambda line: tuple(line.split()), lines) -inst_cap = arch_dll.arch_inst_cap() -mnemo_map = {tuple(arch_dll.arch_inst_mnemonic(byte).decode().split()): byte for byte in range(inst_cap)} +inst_count = 0x80 +mnemo_map = {tuple(arch_dll.arch_inst_mnemonic(byte).decode().split()): byte for byte in range(inst_count)} anc_bytes = [mnemo_map[line] for line in lines] anc_repr = f"{{{",".join(map(str, anc_bytes))}}}" |
