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 -- Peter Gerwinski, Essen, Germany, free physicist and programmer Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - 1 Oct 1997 PGP key fingerprint: AC 6C 94 45 BE 28 A4 96 0E CC E9 12 47 25 82 75 Fight the SPAM! - http://maps.vix.com/
participants (2)
-
Orlando Llanes -
Peter Gerwinski