The African Chief wrote:
Now, that is the interesting bit. Both permutations give a wrong result in BP (DOS real mode and DOS DPMI), but give correct results in BP (Windows) and GPC (DJGPP). Shouldn't they all behave the same?
Not really. Since they're relying on more or less undefined things (such as the contents of the stack area next to some parameter), the behaviour can easily be different on different platforms. It could even be different on the same platform (e.g. in Dos when loaded at different addresses -- or under a debugger). That's the kind of bugs that's hard to track.