//MACRO Tail.far Ep, Arg[]=[], Stack=!"" //-------------------------------------------------------------------------------------------------- // // @ 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. // //-------------------------------------------------------------------------------------------------- // // // Get load MI // eval(DVASM.getEnv()[4]); var ld= "L" + abiWID; if (Label !== "") DVASM.formalLine(Label, "BYTE", "0[0]", ""); // // Pre-process // DVASM.formatLine("", "__PreTail", "[" + Arg + "], " + Stack, ""); // // Issue call // if (Stack !== "") { DVASM.formatLine("", ld, "RA, " + Stack + ".RA", "// Restore return address"); DVASM.formatLine("", "ADDI", "SP, " + Stack + ".StackLen", "// Restore stack register"); } var callLbl= DVASM.getNewLabel(); DVASM.formatLine(callLbl, "AUIPC", "r6, " + Ep + "@_PCREL_HI20", ""); DVASM.formatLine("", "JALR", "r0, " + callLbl + "@_PCREL_LO12_I[r6]", "");