Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / June 2004

Tip: Looking for answers? Try searching our database.

ASM and JNI

Thread view: 
Roedy Green - 29 May 2004 10:40 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?

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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.