It works on Linux x86 with examply the same Assembly codes.
There will be an update with Linux pcall.so library in
next pcall version.

   load 'general/pcall/test_asm'
   sum i.1e4
49995000
   (sum -: +/) i.1e4
1
   2!:0'uname -a'
Linux okdeb 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686 GNU/Linux


--- Eric Iverson <[EMAIL PROTECTED]> wrote:

> I hadn't realized that you had provided this exact mechanism as part of your 
> pcall enhancement. Very nice and interesting. Does it work in linux and mac? 
> I thought some hosts would balk at executing machine instructions from data 
> memory.
> 
> Although useful in some circumstances, I would recommend that in general 
> following the normal route of generating and using a shared library is 
> prefered.
> 
> 
> ----- Original Message ----- 
> From: "Oleg Kobchenko" <[EMAIL PROTECTED]>
> To: "Programming forum" <[email protected]>
> Sent: Saturday, July 14, 2007 12:51 AM
> Subject: Re: [Jprogramming] J API
> 
> 
> > Note that right now you can see and try it with
> > the pcall addon:
> >
> >  http://www.jsoftware.com/svn/addons/trunk/general/pcall/test_asm.ijs
> >
> > The asm codes are parsed by J, put into a noun
> > and executed. The codes are from output
> > of assembler or C compiler.
> >
> >
> > sumProc=: noun asmdefine
> > ;int __stdcall sum(int n, int* y)
> >  00050 55 push ebp
> >  00051 8b ec mov ebp, esp
> >  00055 33 c0 xor eax, eax
> > ....
> >  0006e c2 08 00 ret 8
> > )
> >
> > sum=: [: 'cp2 > i i i *i' pcall (symdat symget <'sumProc') ; (;~#)
> >
> >   (sum -: +/) i.1e4
> > 1
> >
> >
> > --- Don Guinn <[EMAIL PROTECTED]> wrote:
> >
> >> Sounds great! Will be watching for j602.
> >>
> >> On 7/13/07, Raul Miller <[EMAIL PROTECTED]> wrote:
> >> >
> >> > On 7/13/07, Don Guinn <[EMAIL PROTECTED]> wrote:
> >> > > I thought that cd (15!:0) established a special environment to call a
> >> > DLL
> >> > > and could only interface to DLLs. And the DLL had to reside in a 
> >> > > library
> >> > as
> >> > > a file of type DLL. How would I use cd to call a program that resided 
> >> > > in
> >> > a J
> >> > > noun?
> >> >
> >> > As I understand it:
> >> >
> >> > [*] cd brings an image of the DLL into the current environment.
> >> >
> >> > [2] j6.02 which should have the option of referring to pre-existing 
> >> > memory
> >> > (other than a DLL).




 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to