//MACRO Avl.loclast Anchor, Node, NullLbl, WReg, FieldDispl= 0 //-------------------------------------------------------------------------------------------------- // // @ 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/store MIs and word length // eval(DVASM.getEnv()[4]); var ld= "L" + abiWID; var st= "S" + abiWID; var wl= abiWLen; var rightField= wl*2 + "+" + FieldDispl; var right= WReg; // // Generate code // \#Label #ld #Node, #Anchor // Load root node addr in tree \ IF ( #Node == 0 ), GOTO, ID= #NullLbl // Done - tree is empy \ WHILE // Start loop down to the right \ #ld #right, #rightField[#Node] // Get right child addr \ IF ( #right == 0 ), BREAK // Done - first node found \ MV #Node, #right // Copy node addr \ ENDWHILE