gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9ed768a)
raw | patch | inline | side by side (parent: 9ed768a)
author | Doni Pracner <quinnuendo@gmail.com> | |
Mon, 20 Jan 2014 21:54:05 +0000 (22:54 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Mon, 20 Jan 2014 21:54:05 +0000 (22:54 +0100) |
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
index 274bb7e448cd0d90f883ecab19e0093b868ac04a..1682978fd688923fab5f6962073fe3dc93bc377f 100644 (file)
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
prl(cmdToEStack("-tempa"));
break;
}
- //TODO shl, shr
-
+
+ case shl : {
+ prl(getTopTwo());
+ prl("VAR <tempres :=tempb, i:=1 >:");
+ prl("\tFOR i:=1 TO tempa STEP 1 DO tempres := tempres * 2 OD;");
+ prl(cmdToEStack("tempres"));
+ prl("ENDVAR;");
+ break;
+ }
+ case shr : {
+ prl(getTopTwo());
+ prl("VAR <tempres :=tempb, i:=1 >:");
+ prl("\tFOR i:=1 TO tempa STEP 1 DO tempres := tempres DIV 2 OD;");
+ prl(cmdToEStack("tempres"));
+ prl("ENDVAR;");
+ break;
+ }
+
case inc : {
int b1 = get(), b2 = get();
prl(loc(b1)+" := " +loc(b1)+" + "+b2+";");