Re: Embedding machine code
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Feb 26, 2004
- 727 views
----- Original Message ----- From: "Juergen Luethje" <j.lue at gmx.de> To: <EUforum at topica.com> Subject: Re: Embedding machine code > > > Derek wrote: > > > I wanted to use Juergen's 'bit.e' library for doing 32-bit manipulations > > because he uses machine code to achieve get over Euphoria's lack of > > 32-bit integers. > > Thanks.> > > However, the code doesn't work because it has lines like this ... > > > > > > SHIFT_LEFT = define_c_func("", SHL_SPACE, {C_INT, C_INT}, C_INT) > > > > but that gives the error message ... > > > > c:\euphoria\include\dll.e:50 in function define_c_func() > > type_check failure, lib is {} > > As others already wrote, 'bit.e' only works with Eu 2.4 or later, sorry.
Oooops! I've forgotten to change my 'EUDIR' environment symbol back to point to the 2.4 version. Silly me! I'm trying to implement the TEA (Tiny Encryption Algorithm - http://www.ftp.cl.cam.ac.uk/ftp/papers/djw-rmn/djw-rmn-tea.html ) in Euphoria. This is a very simple algo but it works on packets of 4-bytes using shifts, xors, adds, and mults so I very quickly get bit overflows. I'm wanting to use machine code to improve the speed as I'll be using it for real-time encoding/decoding of traffic over a LAN. -- Derek