When you write your JNI in assembler for Windows, and you want to
return a long, which register pair does it go in, and which is the
high order?

Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Roedy Green - 29 May 2004 11:00 GMT
>When you write your JNI in assembler for Windows, and you want to
>return a long, which register pair does it go in, and which is the
>high order?
edx:eax where edx is the high order. I finally found the /FA switch
in the projects settings that generates *.ASM files which lets you
figure out the register conventions by looking an ASM code generated
from C and C++.

Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
glen herrmannsfeldt - 02 Jun 2004 23:57 GMT
> When you write your JNI in assembler for Windows, and you want to
> return a long, which register pair does it go in, and which is the
> high order?
All x86 code that I know of use EDX:EAX with EDX high.
At least one that I know of, the RDTSC instruction,
returns it that way. My favorite JNI has the executable
assembly code:
rdtsc
ret
with a few more instruction to tell the assembler what
to do with it, but that aren't executable.
-- glen
striker - 04 Jun 2004 04:44 GMT
Under win32 you dont need to register pair. EAX is sufficient.
Roedy Green - 04 Jun 2004 05:59 GMT
>Under win32 you dont need to register pair. EAX is sufficient.
for returning a jlong 64 bits you need two registers. edx:eax.
See the source code at http://mindprod.com/products.html#PENTIUM

Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.