gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
mjc2wsl - added optional PRINTs of addresses as the WSL code is executed, plus option...
authorDoni Pracner <quinnuendo@gmail.com>
Sun, 5 Jan 2014 20:27:27 +0000 (21:27 +0100)
committerDoni Pracner <quinnuendo@gmail.com>
Sun, 5 Jan 2014 20:27:27 +0000 (21:27 +0100)
src/mjc2wsl.java

index 917978c8638ab26c787891b2b378ed579594e9a8..76d225b5c73c5f4b3d08b0bc47e966586b13813f 100644 (file)
@@ -32,6 +32,9 @@ public class mjc2wsl{
                        out.println("total errors:"+messageCounters[M_ERR]+" warnings:"+messageCounters[M_WAR]);
        }
        
+       private boolean addPauseAfterEachAddress=false, 
+               addPrintForEachAddress = false;
+       
        /** Constant used for marking a regular comment from the original file */
        public static final char C_REG = ' ';
        /**
@@ -286,6 +289,11 @@ public class mjc2wsl{
                        if (originalInComments)
                                prl(createComment(describeOpCode(op), C_OC));
                        prl("a" + counter + " == ");
+                       if (addPrintForEachAddress) {
+                                       prl("PRINT(\"a"+counter+"\");");
+                                       if (addPauseAfterEachAddress)
+                                                       prl("debug_disposable_string := @Read_Line(Standard_Input_Port);");
+                       }
                        switch (op) {
                        case load: {
                                prl(cmdToEStack(loc(get())));
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner