Re: Rob: Feature request for next release
Subject: Re: Rob: Feature request for next release
Vincent wrote:
>
> Rob, can we have some basic bit shifting routines for the next release:
shift_left()
> and shift_right()? It doesnt matter to me if they are implemented
internally,
> machine_proc/func(), or routines in "misc.e"... anything would do; they
are
> neccessary.
>
>
> Regards,
> Vincent
>
> ----------------------------------------------
>
> .``.
> ',,'
>
>
Vincent:
shifting is already available in Euphoria by
multiplying and dividing by 2.
check the library doc.
see power function
Bernie
My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.exw
Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on
&keywords=bernie+ryan
------------------------------
I'd rather push for rotate() functions that would work on any 32-bit
integers.
Btw, what could be even more useful is to be able to perform elementary
arithmetic on memory locations. For instance, you currently have to type
poke4(a,peek4u(a)+some_value)
Which isn't too good as peek/poke has its overhead. Using call() to do this
is even worse. Rather, an internally built
perform_op(a,PLUS,some_value)
would probably help. Both add some_value at the dword pointed by a.
The needed constants would be:
PLUS
MINUS
MINUS_R -- for reverse substraction
MUL
DIV --store quotient
DIV_R
AND
OR
XOR
Perhaps adding ROR, ROL,SHL and SHR would be good too.
CChris
|
Not Categorized, Please Help
|
|