Using GPC's asm statement allows us to set the function result with an ASM statement, but how do I set the result of a function through an external assembly routine? The Assembler I'll be using is NASM (just in case you need to know). Thanks in advance!
See ya! Orlando Llanes
"Meine Damen und Herren, Elvis hat soeben das Gebaeude verlassen!"
"Look out fo' flyeeng feet" O__/ a010111t@bc.seflin.org /|____. O <__. /> / \ ____________|_________ http://ourworld.compuserve.com/homepages/Monkey414
According to Orlando Llanes:
Using GPC's asm statement allows us to set the function result with an
ASM statement, but how do I set the result of a function through an external assembly routine? [...]
Just guessing - but educatedly (-:
This is defined by the environment (the operating system, in essential) the compiler has to work in.
AFAIK, DJGPP defines 32-bit function return values to be returned in the `eax' register. I do not know about longer values, but you can look it up from `gpc -S foo.pas' *without* optimization. (With optimization, GPC might deviate from this convention in cases where function are always called from the same place where it increases performance to return a value in a non-standard register.)
Peter