Gerd Pokorra wrote:

For tests I want to add a new opcode to Parrot. I created a file
ops/my.ops and do the configuration and make again, but I don't find my
opcode in the file lib/Parrot/OpLib/core.pm. How to add a new opcode?
Can you give me an example.

  Gerd Pokorra

pokorra[at]uni-siegen.de



I think the easiest thing to do is have a look at the dynoplibs directory. In this directory are a few test files with user-defined ops. read the README file. It doesn't quite work for me as it is described there, but that's probably something with my path settings.

Anyhow, this works for me:

according to the readme file, type this: (in the parrot root dir, not in the dynoplibs directory)

   parrot$ export LD_LIBRARY_PATH=.:blib/lib
   parrot$ make -s
   parrot$ make shared
   parrot$ make -C dynoplibs

Then, I have to edit the test.pasm file in the dynoplibs directory a bit: instead of loading "myops_ops", I write:

   loadlib P1, "dynoplibs/myops_ops"

The same is true for the ohter loadlib instructions in the file.
And I run the test.pasm file from the parrot root dir, not from the dynoplibs directory. So:

   parrot$ parrot dynoplibs/test.pasm

Hope this helps,

klaas-jan

Reply via email to