At 08:42 AM 12/26/2001 -0800, Boris Tschirschwitz wrote:
>On Wed, 26 Dec 2001, Jason Gloudon wrote:
>
> > branch is a relative branch, look at the code generated for it:
> >
> > static opcode_t *
> > Parrot_branch_ic (opcode_t cur_opcode[], struct Parrot_Interp * 
> interpreter) {
> >   return cur_opcode + cur_opcode[1];
> > }
>
>Yes, I see.
>In parrot assmebly it looks like an absolute branch.
>The assembler translates 'branch JOHN' to a relative branch.
>I still find it confusing to describe the assmebly opcode 'branch IC' as a
>relative branch, but I suppose thats due to my not being used to the
>conventions.

It's a handy convention, one we've stolen from a long tradition of 
assemblers. :) Branches are traditionally relative offsets while jumps are 
absolute offsets. Having the assembler figure out the offset given a label 
saves a whole lot of hassle, since that's what you're going to be going anyway.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to