From 99fe23adc82fdd0ff139272ce23386e6989287db Mon Sep 17 00:00:00 2001 From: Doni Pracner Date: Sun, 19 Jan 2014 20:05:09 +0100 Subject: [PATCH] mjc2wsl - pop command --- src/mjc2wsl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java index c45de80..5863979 100644 --- a/src/mjc2wsl.java +++ b/src/mjc2wsl.java @@ -253,6 +253,13 @@ public class mjc2wsl{ return res; } + private String cmdPopEStack() { + String res = "mjvm_estack := TAIL(mjvm_estack);"; + if (genPrintEStackOnChange) res +="PRINT(\"eStack\",mjvm_estack);"; + return res; + } + + private String getTopTwo(){ return cmdFromEStack("tempa") + "\n" + cmdFromEStack("tempb"); } @@ -415,7 +422,12 @@ public class mjc2wsl{ } //TODO aload, asstore, baload, bastore //TODO arraylength - //TODO pop, dup, dup2 + //TODO dup, dup2 + + case pop : { + prl(cmdPopEStack()); + break; + } case jmp: { prl("CALL a" + (counter + get2()) + ";"); -- 2.25.1