//MACRO Buffer.set Buffer, Length, PadReg //-------------------------------------------------------------------------------------------------- // // @ 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. // //-------------------------------------------------------------------------------------------------- // // // Set up variables // eval(DVASM.getEnv()[4]); var st= "S" + abiWID; var wl= abiWLen; var wn= abiWID == "D" ? "double word" : "word"; // // Generate code // \#Label ADD #Length, #Buffer // Compute and of buffer addr \ ADDI #Length, -#wl // Subtract #wn to it \ WHILE Condition= ( #Buffer <= #Length ) // Start loop to set all #wn.s \ #st #PadReg, 0[#Buffer] // Store it in the 'to buffer' \ ADDI #Buffer, #wl // Load next #wn address \ ENDWHILE \ ADDI #Length, #wl // Restore end of buffer addr \ WHILE Condition= ( #Buffer < #Length ) // Start residual length loop \ SB #PadReg, 0[#Buffer] // Store char in buffer \ ADDI #Buffer, 1 // Add 1 to buffer addr \ ENDWHILE