At 11:11 PM +0200 4/18/02, Marco Baringer wrote: > >i am attaching a patch to Parrot::OpTrans::CGoto which makes goto >ADDRESS(X) jump to the offset X relative to the start of the byte_code >(in other words interpreter->code->byte_code + X). given this "new" >interpretation of goto ADDRESS() i have found a reason to have jump >and jsr :) jump is like branch, but uses goto ADDRESS() as opposed to >goto OFFSET(), jsr is like bsr but uses goto ADDRESS() as opposed to >goto OFFSET(). relative to this modification of core.ops i have added >a test to t/ops/basic.t to test jsr and modified the test of jump >since its semantics have changed.
Ah, this is incorrect. goto ADDRESS should go to an absolute address, period. It's for use in those times when you *have* an absolute address--for example when you've just fetched the address of a subroutine from a symbol table. Jumping from the start of the bytecode segment is an interesting idea, but since it's only valid when used to transfer control from within the current segment, you might as well just use goto OFFSET instead. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk