From 4a5419687895d1a127fc5535ff907f23ebcadfbb Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 30 Sep 2018 13:33:07 +0100 Subject: [PATCH] add a #define to id_regs.py which indicates name of the instruction the c preprocessor cannot cope with detecting what the name of the instruction is (and when it does, if it is "and" that throws a compile-error), so as a workaround have id_regs.py create a #define INSN_ADD, #define INSN_ADD_I etc. --- id_regs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/id_regs.py b/id_regs.py index b705ec7..0d732b3 100644 --- a/id_regs.py +++ b/id_regs.py @@ -105,4 +105,6 @@ if __name__ == '__main__': regsname = "regs_%s.h" % insn regsname = os.path.join(insns_dir, regsname) with open(regsname, "w") as f: - f.write(find_registers(fname)) + txt = find_registers(fname) + txt += "\n#define INSN_%s\n" % insn.upper() + f.write(txt) -- 2.30.2