AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ASM and JNI

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware
View previous topic :: View next topic  
Author Message
Roedy Green
Guest





PostPosted: Sat May 29, 2004 9:40 am    Post subject: ASM and JNI Reply with quote



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?


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





PostPosted: Sat May 29, 2004 10:00 am    Post subject: Re: ASM and JNI Reply with quote



On Sat, 29 May 2004 09:40:00 GMT, Roedy Green
<look-on (AT) mindprod (DOT) com.invalid> wrote or quoted :

Quote:
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++.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Back to top
glen herrmannsfeldt
Guest





PostPosted: Wed Jun 02, 2004 10:57 pm    Post subject: Re: ASM and JNI Reply with quote



Roedy Green wrote:

Quote:
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


Back to top
striker
Guest





PostPosted: Fri Jun 04, 2004 3:44 am    Post subject: Re: ASM and JNI Reply with quote

Under win32 you dont need to register pair. EAX is sufficient.


Back to top
Roedy Green
Guest





PostPosted: Fri Jun 04, 2004 4:59 am    Post subject: Re: ASM and JNI Reply with quote

On Thu, 03 Jun 2004 23:44:04 -0400, "striker"
<james.ladd (AT) nospam (DOT) clubmarine.com.au> wrote or quoted :

Quote:
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

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

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.