gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
mjc2wsl - op code processing - everything is ordered according to the numbers and...
authorDoni Pracner <quinnuendo@gmail.com>
Tue, 10 Dec 2013 21:45:06 +0000 (22:45 +0100)
committerDoni Pracner <quinnuendo@gmail.com>
Tue, 10 Dec 2013 21:45:06 +0000 (22:45 +0100)
src/mjc2wsl.java

index 53b2b6660a5a2b6a96c1cdba3bdd63f9af15cb6b..b7c572b609049776dfe8e73865b24ce3723d24a1 100644 (file)
@@ -254,6 +254,10 @@ public class mjc2wsl{
                                prl(cmdFromEStack(loc(op - store_0)));
                                break;
                        }
+                       
+                       //TODO getstatic, putstatic
+                       //TODO getfield, putfield
+                       
                        case const_: {
                                prl(cmdToEStack(get4()));
                                break;
@@ -269,24 +273,6 @@ public class mjc2wsl{
                                break;
                        }
 
-                       case jmp: {
-                               prl("CALL a" + (counter + get2()) + ";");
-                               break;
-                       }
-
-                       case jeq:
-                       case jne:
-                       case jlt:
-                       case jle:
-                       case jgt:
-                       case jge: {
-                               prl(getTopTwo());
-                               prl("IF tempb "+ getRelationFor(op)
-                                               +" tempa THEN CALL a" + (counter + get2())
-                                               + " FI;");
-                               break;
-                       }
-
                        case add: {
                                prl(getTopTwo());
                                prl("tempres := tempb + tempa;");
@@ -320,24 +306,52 @@ public class mjc2wsl{
                                break;
                        }
 
-                       case enter: {
-                               prl(createComment("enter not fully procesed yet"));
-                               message("enter not fully procesed yet", M_WAR);
-                               get();
-                               get();
+                       //TODO neg, shl, shr, inc
+                       //TODO new_ newarray
+                       //TODO aload, asstore, baload, bastore
+                       //TODO arraylength
+                       //TODO pop, dup, dup2
+                       
+                       case jmp: {
+                               prl("CALL a" + (counter + get2()) + ";");
                                break;
                        }
+
+                       case jeq:
+                       case jne:
+                       case jlt:
+                       case jle:
+                       case jgt:
+                       case jge: {
+                               prl(getTopTwo());
+                               prl("IF tempb "+ getRelationFor(op)
+                                               +" tempa THEN CALL a" + (counter + get2())
+                                               + " FI;");
+                               break;
+                       }
+
+                       //TODO call
+
                        case return_: {
                                prl(createComment("return not fully procesed yet"));
                                message("return not fully procesed yet", M_WAR);
                                break;
                        }
+                       case enter: {
+                               prl(createComment("enter not fully procesed yet"));
+                               message("enter not fully procesed yet", M_WAR);
+                               get();
+                               get();
+                               break;
+                       }
                        case exit: {
                                prl(createComment("exit not fully procesed yet"));
                                message("exit not fully procesed yet", M_WAR);
                                break;
                        }
 
+                       //TODO read, print
+
                        // the prints
                        case bprint: {
                                prl(getTopTwo());
@@ -356,6 +370,9 @@ public class mjc2wsl{
                                break;
                        }
 
+                       //TODO trap
+
+
                        op = get();
                        if (op >= 0)
                                prl("CALL a" + counter + " END");
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner