//MACRO ENDWHILE Condition= !"", WReg= !"", Far{boolean}= no //-------------------------------------------------------------------------------------------------- // // @ CopyRight Roberti & Parau Enterprises, Inc. 2021-2023 // // This work is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License. // To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/4.0/ // or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. // //-------------------------------------------------------------------------------------------------- // if (Label !== "") DVASM.formatLine(Label, "BYTE", "0[0]", ""); var nestStack= DVASM.getJSGlobal("__arch_condNestBlockStack"); if (nestStack == null) nestStack= []; var n= nestStack.length-1; // // Check if inner nesting is WHILE // var n= nestStack.length-1; if (n < 0) return DVASM.putError("No nest block is current to match [ ENDWHILE ]"); var whileBlock= nestStack[n]; if (whileBlock[0] != "WHILE") return DVASM.putError("Inner nest block is [" + whileBlock[0] + "] and cannot be ended by [ ENDWHILE ]"); // // Insert after code if any // for (var i= 0; i < whileBlock[5].length; i++) DVASM.formatLine("", whileBlock[5][i].trim(), "", ""); // // Process While and ENDWHILE conditions if any // if (whileBlock.length > 6) { if (Condition !== "") DVASM.formatLine("", "__CondGen", Condition + ", false, " + whileBlock[3] + ", " + DVASM.getNewLabel() + ", WReg= " + WReg + ", no", ""); DVASM.formatLine("", "__CondGen", whileBlock[6] + ", false, " + whileBlock[2] + ", " + whileBlock[3] + ", WReg= " + WReg + ", " + Far, ""); } else { if (Condition !== "") DVASM.formatLine("", "__CondGen", Condition + ", true, " + whileBlock[3] + ", " + whileBlock[2] + ", WReg= " + WReg + ", " + Far, ""); else { DVASM.formatLine("", "JAL", whileBlock[2], ""); DVASM.formatLine(whileBlock[3], "BYTE", "0[0]", ""); } } DVASM.formatLine("", "INDENTOUT", "", ""); nestStack.pop(); DVASM.putJSGlobal("__arch_condNestBlockStack", nestStack);