1. Low level euphoria

This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C315C2.4DBBD520
	charset="iso-8859-1"

Dear Rob,

I'm a very happy euphoria programmer, and I was thinking how much =
happier I would be if I could pass parameters strait to asm, and asm =
could pass params strait back. Now I know this is very similar(if not =
the same thing as c_func/c_proc/call_back) to what is available, but I'm =
a dos programmer mainly, and while I understand C and can use it well, I =
don't want to(make some kind of dos-dll system). I would very much =
apprecitive if the c_func/c_proc/call_back could be extended/combined =
with call(for asm) so I could say(do the below), I like call_back the =
way it is, but I think it should be extended to dos also(PLEASE) =
although this may require making alot of the euphoria interpreter =
reerrant(which may be more work than I relise), but the =
asm_func/asm_proc/asm_define_func/asm_define_proc should be very easy. =
Another reason for all of this is because one major things I've noticed =
is that when(In dos) I call an asm with atoms(not integer, i mean =
floating P's) the atom_to_float32/64 is very slow compared to win32's =
c_func with C_DOUBLE/C_FLOAT params, and thats probably somthing to do =
with the calling process being all builtin and not jumping back and =
forth between builtin and eu code(atom_to_float32, then poke, then call, =
then peek4, then float32_to_atom()).
I do think that a good programmer can get around the no call_back in =
dos(I have, but I wish I didn't have to) but I think the rest is way =
more needed. I hope you can see what I mean. Do keep the existing =
constructs, they have there purpose but these are more specialized for =
asm(which is all about being fast and simple, like euphoria).

Thank you very much for euphoria(I think I speak for everyone)
Daniel Kluss

<<<<<<<<<<<<<<<<<<<<<<
constant=20
func1_asm=3Dcompile_asm("pusha\n have fun\n popa\n push val1\n ret\n"),
func1_mem=3Dallocate(length(func1)),
proc1_asm=3Dcompile_asm("pusha\n have fun\n popa\n ret\n"),
proc1_mem=3Dallocate(length(proc1))

poke(func1_mem,func1_asm)
poke(proc1_mem,proc1_asm)
constant
func1=3Ddefine_asm_func(func1_mem,{C_INT,C_DOUBLE,,,,,},C_INT),
proc1=3Ddefine_asm_proc(proc1_mem,{C_FLOAT,C_UINT,,,},C_POINTER),
a=3D1,b=3D4.5,c=3D8.1,d=3D#FFFFFFFF

? asm_func(func1,{a,b})
asm_proc(proc1,{c,d})
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Saythankyoubeforeaskingforsomething
------=_NextPart_000_0005_01C315C2.4DBBD520
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Rob,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm a very happy euphoria programmer, =
and I was=20
thinking how much happier I would be if I could pass parameters strait =
to asm,=20
and asm could pass params strait back. Now I know this is very =
similar(if not=20
the same thing as c_func/c_proc/call_back)&nbsp;to what is available, =
but I'm a=20
dos programmer mainly, and while I understand C and can use it well, I =
don't=20
want to(make some kind of dos-dll system). I would very much apprecitive =
if the=20
c_func/c_proc/call_back could be extended/combined with call(for asm) so =
I could=20
say(do the below), I like call_back the way it is, but I think it should =
be=20
extended to dos also(PLEASE) although this may require making alot of =
the=20
euphoria interpreter reerrant(which may be more work than I relise), but =
the=20
asm_func/asm_proc/asm_define_func/asm_define_proc should be very easy. =
Another=20
reason for all of this is because one major things I've noticed is that =
when(In=20
dos) I call an asm with atoms(not integer, i mean floating P's) the=20
atom_to_float32/64 is very slow compared to win32's c_func with =
C_DOUBLE/C_FLOAT=20
params, and thats probably somthing to do with the calling process being =

all&nbsp;builtin and not jumping back and forth between builtin and eu=20
code(atom_to_float32, then poke, then call, then peek4, then=20
float32_to_atom()).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I do think that a good programmer can =
get around=20
the no call_back in dos(I have, but I wish I didn't have to) but I think =
the=20
rest&nbsp;is way more needed. </FONT><FONT face=3DArial size=3D2>I hope =
you can see=20
what I mean. Do keep the existing constructs, they have there purpose =
but these=20
are more specialized for asm(which&nbsp;is all about being fast and =
simple, like=20
euphoria).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank you very much for euphoria(I =
think I speak=20
for everyone)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Daniel Kluss</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;=
&lt;&lt;&lt;&lt;&lt;&lt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>constant </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>func1_asm=3Dcompile_asm("pusha\n have =
fun\n popa\n=20
push val1\n ret\n"),</FONT></DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial =
size=3D2>func1_mem=3Dallocate(length(func1)),</FONT></DIV>
<DIV>proc1_asm=3Dcompile_asm("pusha\n have fun\n popa\n ret\n"),</DIV>
<DIV>proc1_mem=3Dallocate(length(proc1))</DIV>
<DIV>&nbsp;</DIV>
<DIV>poke(func1_mem,func1_asm)</DIV>
<DIV>poke(proc1_mem,proc1_asm)</DIV>
<DIV>constant</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>func1=3D</FONT><FONT face=3DArial=20
size=3D2>define_asm_func(func1_mem,{C_INT,C_DOUBLE,,,,,},C_INT),</FONT></=
DIV>
<DIV><FONT face=3DArial=20
size=3D2>proc1=3Ddefine_asm_proc(proc1_mem,{C_FLOAT,C_UINT,,,},C_POINTER)=
,</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>a=3D1,b=3D4.5,c=3D8.1,d=3D#FFFFFFFF</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>? asm_func(func1,{a,b})</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>asm_proc(proc1,{c,d})</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;=
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&=
lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</FONT></DIV>
<DIV><FONT face=3DArial=20

------=_NextPart_000_0005_01C315C2.4DBBD520--

new topic     » topic index » view message » categorize

2. Re: Low level euphoria

I have asked for the same thing (i think i even used the very same routine 
names) on an earlier occation. I don't however like the idea of having the 
assembler built into Euphoria, that way only Rob could add new opcodes when 
nessecary. Pete's asm.e is much more flexible. As far as being a DOS 
programmer, i've written a library that let's you use dll:s in DOS/Linux, 
just like you would with dll.e. You can even use some winapi functions (in 
DOS). Search for "dll" under GEN files in the archive..



><<<<<<<<<<<<<<<<<<<<<<
>constant
>func1_asm=compile_asm("pusha\n have fun\n popa\n push val1\n ret\n"),
>func1_mem=allocate(length(func1)),
>proc1_asm=compile_asm("pusha\n have fun\n popa\n ret\n"),
>proc1_mem=allocate(length(proc1))
>
>poke(func1_mem,func1_asm)
>poke(proc1_mem,proc1_asm)
>constant
>func1=define_asm_func(func1_mem,{C_INT,C_DOUBLE,,,,,},C_INT),
>proc1=define_asm_proc(proc1_mem,{C_FLOAT,C_UINT,,,},C_POINTER),
>a=1,b=4.5,c=8.1,d=#FFFFFFFF
>
>? asm_func(func1,{a,b})
>asm_proc(proc1,{c,d})
><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>Saythankyoubeforeaskingforsomething
>
>
>
>TOPICA - Start your own email discussion group. FREE!

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

3. Re: Low level euphoria

I don't mean have compiling the asm builtin, I mean making the calls to it
builtin, for speed.
I prefer to be able to compile the asm myself anyway.
I think there would be a great speed increase because
float_to_atomXX/atom_to_floatXX is very slow compared to c_func(X,{C_FLOAT's
and C_DOUBLE's}) thats what I want.
Daniel Kluss

----- Original Message ----- 
From: "Matt Lewis" <matthewwalkerlewis at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: Low level euphoria


>
>
> > From: xerox_irs at lvcm.com [mailto:xerox_irs at lvcm.com]
>
>
> > I'm a very happy euphoria programmer, and I was thinking how much
> > happier I would be if I could pass parameters strait to asm, and
> > asm could pass params strait back. Now I know this is very similar
> > (if not the same thing as c_func/c_proc/call_back) to what is available,
> > but I'm a dos programmer mainly, and while I understand C and can
> > use it well, I don't want to(make some kind of dos-dll system). I
> > would very much apprecitive if the c_func/c_proc/call_back could be
> > extended/combined with call(for asm) so I could say(do the below),
> > I like call_back the way it is, but I think it should be extended to
> > dos also(PLEASE) although this may require making alot of the euphoria
> > interpreter reerrant(which may be more work than I relise), but the
> > asm_func/asm_proc/asm_define_func/asm_define_proc should be very easy.
> > Another reason for all of this is because one major things I've noticed
> > is that when(In dos) I call an asm with atoms(not integer, i mean
> > floating P's) the atom_to_float32/64 is very slow compared to win32's
> > c_func with C_DOUBLE/C_FLOAT params, and thats probably somthing to do
> > with the calling process being all builtin and not jumping back and
forth
> > between builtin and eu code(atom_to_float32, then poke, then call, then
> > peek4, then float32_to_atom()).
>
> As was mentioned, Pete's asm.e (see the archives) is a very handy tool for
> using asm in Euphoria.  I've got a tool that allows you to call a function
> by pointer.  Of course, usually it's really a compiled C/C++ function, but
> it's the calling convention that matters.  Check out fptr.e.  You can get
it
> at my page:
>
> http://www14.brinkster.com/matthewlewis/projects.html
>
> It lets you call any routine so long as you know its address, and allows
> passing parameters.
>
> Matt Lewis
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

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

4. Re: Low level euphoria

Daniel Kluss wrote:
> I'm a very happy euphoria programmer, and I was thinking how much 
> happier I would be if I could pass parameters strait to asm, and asm 
> could pass params strait back. 

Thanks for your discussion of the problem.
I've been asked for that before.
I'll bump up the priority, but it won't make it
into the next release (2.4 Official).
I'm getting ready to turn the crank
on the Official release (maybe a week or so with all
the various .exe's and libraries to build and test).

As for atom_to_float64() and float64_to_atom(),
I think the internal code for these is pretty simple and
fairly fast (see Interpreter source: machine.c),
although not as fast as your proposed parameter passing
system would be.

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

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

5. Re: Low level euphoria

Message=repeat("Thank You", power(2,32))
i think you get the idea

Daniel KLuss

----- Original Message ----- 
From: "Robert Craig" <rds at RapidEuphoria.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Low level euphoria


> 
> Daniel Kluss wrote:
> > I'm a very happy euphoria programmer, and I was thinking how much 
> > happier I would be if I could pass parameters strait to asm, and asm 
> > could pass params strait back. 
> 
> Thanks for your discussion of the problem.
> I've been asked for that before.
> I'll bump up the priority, but it won't make it
> into the next release (2.4 Official).
> I'm getting ready to turn the crank
> on the Official release (maybe a week or so with all
> the various .exe's and libraries to build and test).
> 
> As for atom_to_float64() and float64_to_atom(),
> I think the internal code for these is pretty simple and
> fairly fast (see Interpreter source: machine.c),
> although not as fast as your proposed parameter passing
> system would be.
> 
> Thanks,
>     Rob Craig
>     Rapid Deployment Software
>     http://www.RapidEuphoria.com
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu