//MACRO Cdll.find Anchor, CompToken, Node, CompMacro, NullLbl, WReg[1-32], FieldDispl= 0, Remove{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. // //-------------------------------------------------------------------------------------------------- // // // Get the right load and store MIs // eval(DVASM.getEnv()[4]); var wrd= abiWID + "WRD"; var ld= "L" + abiWID; var st= "S" + abiWID; var wl= abiWLen; var matchLabel= DVASM.getNewLabel(); var prevField= FieldDispl; var nextField= wl + "+" + FieldDispl; // // Get working registers list // if (WReg.length < 3 && Remove) return DVASM.putError("Number of work registers is [" + WReg.length + "] - it must be at least 3 when Remove option is used"); var first= WReg[0]; if (Remove) { var next= WReg[1]; var prev= WReg[2]; var compareWReg= "[" + WReg.slice(3) + "]"; } else var compareWReg= "[" + WReg.slice(1) + "]"; // // Generate code // \#Label #ld #Node, #Anchor // Load first node in list \ IF ( #Node == 0 ), GOTO, ID= #NullLbl // Done if list is empty \ MV #first, #Node // Copy first node addr to check end of list \ WHILE // Start search loop \ #CompMacro #CompToken, #Node, #matchLabel, #compareWReg // Check if match and process node if so \ #ld #Node, #nextField[#Node] // Get next node \ IF ( #Node == #first ), GOTO, ID= #NullLbl // Done - node not found \ ENDWHILE \#matchLabel BYTE 0[0] // // Remove node if requested // if (Remove) { \ #ld #next, #nextField[#Node] // Get next node addr \ IF ( #Node == #next ), THEN // Check if only one node in list \ #st 0, #Anchor // Set list to empty \