From 41e1c3ef743ff7f820b5d063e1ad57a90f4b8744 Mon Sep 17 00:00:00 2001 From: Izaya Date: Sat, 11 Feb 2017 19:41:22 +0000 Subject: [PATCH] Updated for ISA changes --- sasm.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sasm.lua b/sasm.lua index d14da21..394072c 100644 --- a/sasm.lua +++ b/sasm.lua @@ -18,6 +18,23 @@ insc.sub = 4090 insc.jmp = 4089 insc.sez = 4088 +local f=io.open("ins.def","rb") +local c = ""; +if f then + c=f:read("*a") + f:close() + insd,insc = {}, {} + for l in c:gmatch("(.+)\n") do + lt = {} + for w in l:gmatch("%S+") do table.insert(lt,w) end + insc[lt[2]] = tonumber(lt[1]) + insd[tonumber(lt[1])] = lt[2] + end +end + +if not tArgs[2] then + error("requires a file argument and a compile/decompile flag") +end f = io.open(tArgs[2],"rb") if not f then error("file inaccessable") end c = f:read("*a")