//MACRO Hash Anchor, Key, WReg[2] //-------------------------------------------------------------------------------------------------- // // @ 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 ld= "L" + abiWID; var wl= abiWLen; var WReg0= WReg[0]; var WReg1= WReg[1]; // // Generate code // \#Label LWU #WReg0, (2*#wl)+#Anchor // Load key shift \ SRL #WReg1, #Key, #WReg0 // Shift Key right \ XOR #Key, #WReg1 // XOR shifted key with original key \ #ld #WReg1, #wl+#Anchor // Load prime number \ MUL #Key, #WReg1 // Multiply shifted and XORed key by prime number \ SRL #Key, #WReg0 // Shift key right \ LWU #WReg0, (2*#wl+4)+#Anchor // Load cell shift \ SLL #Key, #WReg0 // Shift key left - offset in hash vector \ #ld #WReg0, #Anchor // Load hash vector addr \ ADD #Key, #WReg0 // Add vector address - hash cell addr