1 # Copyright (C) 2001-2005, Parrot Foundation.
6 examples/subs/pasm_sub1.pasm - Parrot calling conventions
10 % ./parrot examples/subs/pasm_sub1.pasm
14 Sample subroutines in Parrot assembler.
15 Shows you how to create a C<.Sub> and C<invokecc> it.
19 Examples for parameter passing.
24 F<docs/pdds/pdd03_calling_conventions.pod>
28 # Fetch a subroutine objec
29 .const 'Sub' P0 = "_sub"
31 # Call the sub in argument, create return continuation
34 # got here, because the sub invoked the return continuation
35 print "Hello from main\n"
41 print "Hello from subroutine\n"
43 # Call the return continuation
50 # vim: expandtab shiftwidth=4 ft=pir: