From 5d9ca414fe33cd8b28373f32ada10601123dfe24 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Thu, 29 Dec 2016 22:48:40 +0100 Subject: [PATCH] remove jif instruction and add optional jump condition to jmp M standardbefehlssatz.lua --- standardbefehlssatz.lua | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/standardbefehlssatz.lua b/standardbefehlssatz.lua index 0dbdbea..b149286 100644 --- a/standardbefehlssatz.lua +++ b/standardbefehlssatz.lua @@ -100,7 +100,12 @@ s = { end, jmp = function(params, faden) - if #params ~= 1 then + local pcnt = #params + if pcnt == 2 then + if not params[2] then + return true + end + elseif pcnt ~= 1 then return false, WNOA end local p = params[1] @@ -119,19 +124,6 @@ s = { return true end, - jif = function(params, faden) - if #params ~= 2 then - return false, WNOA - end - if params[1] then - local jmpd,msg = s.jmp({params[2]}, faden) - if not jmpd then - return false, SE .. msg - end - end - return true - end, - call = function(params, faden) if #params ~= 1 then return false, WNOA