1. Help: LongLong C func return value (not piano lessons)
- Posted by Al Getz <Xaxo at aol.com> Mar 01, 2006
- 438 views
- Last edited Mar 02, 2006
Hello there, I've called countless C function in dll's and got a long or ulong return value, but now i need to get a longlong value returned. Any way to do this in Euphoria? Here's the C function: --------------------------------------------------------------------------------- LONGLONG Int32x32To64( LONG Multiplier, // 1st signed 32-bit integer for the multiplication LONG Multiplicand // 2nd signed 32-bit integer for the multiplication ); Please note that the function's return value is a 64-bit value, not a LARGE_INTEGER structure. --------------------------------------------------------------------------------- This function takes two 32 bit numbers and multiplies them, then returns the 64 bit value as a 'value', not as a structure of two 32 bit values (ie not a pointer). If not in raw Euphoria, then perhaps some suggestions for some machine code? (Intel based please) The machine code would have to access this function (link to it, NOT do the multiplication itself), and NOT in a dll where the C func can be called and return value poked into memory. Thanks. Take care, Al And, good luck with your Euphoria programming! My bumper sticker: "I brake for LED's"
2. Re: Help: LongLong C func return value (not piano lessons)
- Posted by Bernie Ryan <xotron at bluefrog.com> Mar 01, 2006
- 427 views
- Last edited Mar 02, 2006
Al Getz wrote: > > Hello there, > > > I've called countless C function in dll's and got a long or ulong > return value, but now i need to get a longlong value returned. > Any way to do this in Euphoria? > > Here's the C function: > > > --------------------------------------------------------------------------------- > LONGLONG Int32x32To64( > LONG Multiplier, // 1st signed 32-bit integer for the multiplication > LONG Multiplicand // 2nd signed 32-bit integer for the multiplication > ); > > Please note that the function's return value is a 64-bit value, > not a LARGE_INTEGER structure. > > --------------------------------------------------------------------------------- > > This function takes two 32 bit numbers and multiplies them, then returns > the 64 bit value as a 'value', not as a structure of two 32 bit values > (ie not a pointer). > > If not in raw Euphoria, then perhaps some suggestions for some > machine code? (Intel based please) > The machine code would have to access this function (link to it, > NOT do the multiplication itself), and NOT in a dll where the C func > can be called and return value poked into memory. Thanks. > > > Al > > > My bumper sticker: "I brake for LED's" Al: How about defining the return as a C_DOUBLE which is 8 bytes ? Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
3. Re: Help: LongLong C func return value (not piano lessons)
- Posted by Al Getz <Xaxo at aol.com> Mar 01, 2006
- 449 views
- Last edited Mar 02, 2006
Bernie Ryan wrote: > > Al Getz wrote: > > > > Hello there, > > > > > > I've called countless C function in dll's and got a long or ulong > > return value, but now i need to get a longlong value returned. > > Any way to do this in Euphoria? > > > > Here's the C function: > > > > > > --------------------------------------------------------------------------------- > > LONGLONG Int32x32To64( > > LONG Multiplier, // 1st signed 32-bit integer for the multiplication > > LONG Multiplicand // 2nd signed 32-bit integer for the multiplication > > ); > > > > Please note that the function's return value is a 64-bit value, > > not a LARGE_INTEGER structure. > > > > --------------------------------------------------------------------------------- > > > > This function takes two 32 bit numbers and multiplies them, then returns > > the 64 bit value as a 'value', not as a structure of two 32 bit values > > (ie not a pointer). > > > > If not in raw Euphoria, then perhaps some suggestions for some > > machine code? (Intel based please) > > The machine code would have to access this function (link to it, > > NOT do the multiplication itself), and NOT in a dll where the C func > > can be called and return value poked into memory. Thanks. > > > > > > Al > > > > > > My bumper sticker: "I brake for LED's" > > Al: > > How about defining the return as a C_DOUBLE which is 8 bytes ? > > Bernie > > My files in archive: > WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API > > Can be downloaded here: > <a > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a> Hello Bernie, I'll try it, and it sounds good to me as i can then use the atom convert to sequence function to convert to 8 bytes. Thanks for the idea. Take care, Al And, good luck with your Euphoria programming! My bumper sticker: "I brake for LED's"