gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
mjc2wsl - pop command
authorDoni Pracner <quinnuendo@gmail.com>
Sun, 19 Jan 2014 19:05:09 +0000 (20:05 +0100)
committerDoni Pracner <quinnuendo@gmail.com>
Sun, 19 Jan 2014 19:05:09 +0000 (20:05 +0100)
src/mjc2wsl.java

index c45de80f96e614e9652247d1919598fca3245f79..586397978394039c45dc3a1d512405e6b529015f 100644 (file)
@@ -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()) + ";");
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner