From: Doni Pracner Date: Sun, 19 Jan 2014 19:05:09 +0000 (+0100) Subject: mjc2wsl - pop command X-Git-Tag: v0.1.4~24 X-Git-Url: https://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;h=99fe23adc82fdd0ff139272ce23386e6989287db;p=mjc2wsl.git mjc2wsl - pop command --- 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()) + ";");