From f322b55a84e842143f87042846f0ecfc9da80ed8 Mon Sep 17 00:00:00 2001 From: Izaya Date: Sun, 12 Feb 2017 01:58:27 +0000 Subject: [PATCH] moved to test3d-tools --- test3d_t400/emut400.lua | 51 ----------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 test3d_t400/emut400.lua diff --git a/test3d_t400/emut400.lua b/test3d_t400/emut400.lua deleted file mode 100644 index 20c27ac..0000000 --- a/test3d_t400/emut400.lua +++ /dev/null @@ -1,51 +0,0 @@ -stab = {} -stab.stack = {} -stab.pc = 1 -stab.cins = 0 -mem = {} -t400 = require "t400" - -while true do - io.write("*> ") - i=io.read() - it = {} - for s in i:gmatch("%S+") do it[#it+1] = s end - if it[1] == "peek" then - print(mem[tonumber(it[2])]) - elseif it[1] == "poke" then - mem[tonumber(it[2])] = tonumber(it[3]) - elseif it[1] == "push" then - stab.stack[#stab.stack+1] = tonumber(it[2]) - elseif it[1] == "dumpstack" then - for k,v in ipairs(stab.stack) do print(k,v) end - elseif it[1] == "ppc" then - print(stab.pc) - elseif it[1] == "spc" then - stab.pc=tonumber(it[2]) - elseif it[1] == "step" then - local scount = tonumber(it[2]) or 1 - for i = 1, scount do - stab.cins = mem[stab.pc] - stab,rw,addr,val=t400.run(stab) - if rw == "halt" then break end - if rw == "read" then - stab.stack[#stab.stack+1] = mem[addr] - elseif rw == "write" then - mem[addr] = dat - end - end - elseif it[1] == "load" then - local f,e = io.open(it[2]) - if f == nil then - print("Error: "..e) - else - local n = tonumber(it[3]) or 0 - local c = f:read("*a") - f:close() - for v in c:gmatch("%S+") do - mem[n] = tonumber(v) or 0 - n = n + 1 - end - end - end -end