Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

main is just a sub

7 views
Skip to first unread message

Leopold Toetsch

unread,
Nov 17, 2004, 5:33:29 AM11/17/04
to Perl 6 Internals
Parrot starts execution at the first sub (or that one denoted with
@MAIN). This subroutine is called with pdd03 calling conventions like
any other sub. So we have:

P5 ... argv array
I0 = 0, I3 = 1 ... one PMC argument passed

A tailcall at the end of main is a valid operation to represent this
code snippet:

.main
...
foo()
.end

as well as a .return() directive (or the omission of one, as missing
return sequences are inserted by imcc).

The only difference is that a return result of main is *not* promoted to
the parent process, this can be achieved by the C<exit> opcode.

Please note: PASM code still needs an "end" or the upcoming "returncc"
opcode.

leo

0 new messages