1. QWORD (int64) question

I think I asked this before, but I would like to know how to get return 
values that are QWORD's. Someone said that QWORD's are pointers, but they 
are not. When passing QWORD's they use two INT's in VB, so it is definitely 
not 32 bits. I am guessing that I would have to use ASM to do this. From my 
limited knowledge of 16-bit assembler, I happen to know that return values 
that were 32 bits (which was not as usual, of course) were in DX:AX. So, I'm 
guessing that in 32-bit assembly a 64-bit value would be returned in 
EDX:EAX. Any help would be appreciated.



Euphoria Instant Messenger
Have YOU Joined?
http://groups.yahoo.com/group/euim/

new topic     » topic index » view message » categorize

2. Re: QWORD (int64) question

Elliott Sales de Andrade writes:
> I think I asked this before, but I would like to know how 
> to get return values that are QWORD's. Someone said 
> that QWORD's are pointers, but they are not. When 
> passing QWORD's they use two INT's in VB, so it is definitely 
> not 32 bits. I am guessing that I would have to use ASM to do this.

I think you can probably *pass* 64-bit integers by
passing two consecutive 32-bit arguments. 
They'll be pushed on the call stack.
Be careful to get them in the right order.

As for receiving a 64-bit integer as a result,
I don't know what the C calling convention is for that.
As a wild guess, unlikely to work, but maybe worth a shot,
you could try declaring (via define_c_func()), the return
value as C_DOUBLE, and then recover the 8 bytes that
are returned using atom_to_float64(). I think doubles
are returned in a floating-point register, so they'd have to
return the 64-bit integer in the same register, which isn't too likely.
More likely, they use two 32-bit registers. You'd have to
maybe disassemble some compiled C code to get the answer,
and then use some machine code similar to Matt Lewis' DLL code.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu