Marcus writes:
>I wonder if it's possible to add your own custom opcodes yet. What I have
>in mind are ops for about 10 external functions. AFAIK, there are at least
>four things that need to be added:
>
>1. The bytecode format need codes for the new ops.
>
>2. The assembler format need names for the new ops.
>
>3. Both 1 and 2 need defined arguments to each op.
>
>4. The actual code that the new ops execute. FYI, they should call
>   functions in a shared library.
>
>Unfortunately, the docs doesn't seem to reveal where or how to add these
>things. Some mails by Gregor give a few hints, but it's not enough.

Hi Marcus,

Have you checked out 'core.ops' in the upper level parrot directory?
Once you add your ops you want to do a complete remake which will
regenerate
the assembler as well to recognize your new stuff. I didn't write any of
that code
but it worked for me when I needed to add my own stuff.

That is probably the place to start if you want to stick in your own
functions.

>
>It's also possible that I need to use an external type or C++ class as
>argument (read-only) for some of the ops, which I suppose means I need
>to use PMCs. Is this possible yet?

Yes, I think Jeff just did a PerlArray PMC commit today so maybe you could
check out his patch
or that crappy IO patch I posted a week ago.

Start by looking at 'include/parrot/pmc.h'.

Hope that helps,


-Melvin Smith

IBM :: Atlanta Innovation Center
[EMAIL PROTECTED] :: 770-835-6984

Reply via email to