On Thu, Apr 18, 2002 at 01:49:20PM +0200, Marco Baringer wrote: > in trying to make goto ADDRESS($1) work as it should i have come > across the following doubt:
How are you interpreting that it "should" work ? I don't know of any documentation that says what it should do, but currently it is only used to support the enternative op, which allows programs generated by pbc2c.pl to combine the execution of ops that have been compiled to native code via C with the normal interpreted execution. So thus far, goto ADDRESS(X) means set the program counter to the pointer value X. > out of core_ops.c, core_ops_cg.c and core_ops_prederef.c which one is > parrot using? and how do i change it if i want? i notice while Just in case you missed it: You should not edit those files, since they are all generated from core.ops by the various ops2*.pl scripts. core_ops_cg is used if your compiler is a version of gcc that supports computed goto, core_ops.c otherwise. If you are trying to change what goto ADDRESS() does you potentially have to modify all of the OpTrans modules under parrot/lib/Parrot/OpTrans > p.s. - i think the problem is related to directly setting cur_opcode > to interpreter->int_reg.registers[cur_opcode[1]] and not something > like interpreter->code->byte_code + $1, could this be? Ok, so you expect goto ADDRESS(X) to jump to the opcode at address X, relative to the start of the byte code. It probably makes sense to rename the current ADDRESS() to something like OPPOINTER() or a name that gives a better idea of what it does and to document all the address expressions while 'fixing' ADDRESS. -- Jason