[fpc-pascal] Is this behavior related to calling convention?

Xiangrong Fang xrfang at gmail.com
Sat Dec 7 09:40:32 CET 2013

I have this function:

function Compare(v1, v2: Integer): Integer;

And called like this:

Result := Compare(stack.Pop, stack.Pop);

The behavior is that the second Pop is evaluated first, thus reversed the
meaning of the function.

Is it true that all parameter evaluation goes from right to left?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20131207/b446f570/attachment.html>

More information about the fpc-pascal mailing list