<html>1. why you leave "time:=..." in benchmark loop? It does add 50% of execution time per call.<br />
2. Pascal version does not match assembler version. Had to fix it.<br />
//Result := X + Counter + $87654321;<br />
Result:=Result + X + $87654321;<br />
Result:=Result xor y;<br />
3. Assembler functions can be unified to work under win64,win32, linux 64, linux 32<br />
function Checksum_LEA(const Input, X, Y: LongWord): LongWord; assembler; nostackframe;<br />
asm<br />
@Loop2:<br />
LEA Input, [Input + X + $87654321]<br />
XOR Input, y<br />
DEC y<br />
JNZ @Loop2<br />
MOV EAX, Input<br />
end;<br />
<br />
4. My results. Ryzen 2700x<br />
<br />
Pascal control case: 0.7 ns/call 0.0710<br />
Using LEA instruction: 0.7 ns/call 0.0700<br />
Using ADD instructions: 0.7 ns/call 0.0710<br />
<br />
Even thou results are equal, i was able to add 4 independent ADD instructions around LEA while results didn't chance, but only 2 around ADD.</html>