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")