On Mon, Sep 17, 2001 at 05:52:19PM -0400, Dan Sugalski wrote:
> >Which is really going to screw up backpatching. :(
> 
> Maybe. I don't think it's as big a deal as you might think it is, since we 
> vector through a register, and you can just patch the register load.

The reason I started looking at this was because the test suite contains
this:

    skip( "label constants unimplemented in assembler", 1 );
    set I4, 42
    set I5, HERE
    jump    I5
    set I4, 1234
HERE:
    print   I4
    end

Since HERE isn't known when it's first encountered, we leave a space
for backpatching. But when we backpatch, to get it right, we need to
be aware that we're doing a set, and produce an absolute rather than
a relative address. This isn't easy. Especially since to make that
work, we need to know that the register will be used to do a jump and
not a branch. Consider:

set     I5, WHEREVER

        if I1, HERE, THERE
HERE:   jump I5
THERE:  branch I5

When we do the set, should WHEREVER be a relative or an absolute 
address?

-- 
dd.c:   sbrk(64);       /* For good measure */
    - plan9 has a bad day

Reply via email to