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



Reply via email to