.sub _main
newsub $P0, Sub, _foo
invokecc $P0
end
.end
.sub _foo
# ...
.end
Indeed, it can be done by using C<addr> and C<set>, but shouldn't sub
names be considered global labels, too?
Luke
[ bug ]
I've fixed it somehow - still calling conventions stuff is missing.
(the register allocator will happily globber the return continuation in
the sub if not written explictely as P1).
This works now:
.sub _main
newsub P0, .Sub, _foo # note the dot
invokecc P0
end
.end
.sub _foo
print "foo\n"
invoke P1
.end
> Luke
leo
[ snip ]
> Indeed, it can be done by using C<addr> and C<set>, but shouldn't sub
> names be considered global labels, too?
Of course. But newsub and the whole calling convention stuff isn't
finished yet. Meaning the newsub opcode doesn't work yet in PIR code,
global fixup is missing ...
> Luke
leo