gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
mjc2wsl - dup, dup2 commands
authorDoni Pracner <quinnuendo@gmail.com>
Mon, 20 Jan 2014 17:06:20 +0000 (18:06 +0100)
committerDoni Pracner <quinnuendo@gmail.com>
Mon, 20 Jan 2014 17:06:20 +0000 (18:06 +0100)
src/mjc2wsl.java

index 6f7efe17b770d362c6af3324582bb2336f4a44e5..4b231aab04e6d3fdb2c0d84d63aff4713b0f9f5a 100644 (file)
@@ -473,7 +473,20 @@ public class mjc2wsl{
                                break;
                        }
                        
-                       //TODO dup, dup2
+                       case dup : {
+                                       prl(getTop());
+                                       prl(cmdToEStack("tempa"));
+                                       prl(cmdToEStack("tempa"));
+                                       break;                                  
+                       }
+                       case dup2 : {
+                                       prl(getTopTwo());
+                                       prl(cmdToEStack("tempb"));
+                                       prl(cmdToEStack("tempa"));
+                                       prl(cmdToEStack("tempb"));
+                                       prl(cmdToEStack("tempa"));
+                                       break;                                  
+                       }
                        
                        case pop : {
                                        prl(cmdPopEStack());
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner