cvsuser 03/06/24 06:59:01
Modified: languages/imcc/docs calling_conventions.pod
Log:
docu update
Revision Changes Path
1.4 +19 -7 parrot/languages/imcc/docs/calling_conventions.pod
Index: calling_conventions.pod
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/docs/calling_conventions.pod,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- calling_conventions.pod 22 May 2003 15:01:57 -0000 1.3
+++ calling_conventions.pod 24 Jun 2003 13:59:01 -0000 1.4
@@ -96,35 +96,47 @@
Implemented. When the subroutine does B<saveall>/B<restoreall>, the
branch from the B<ret> statement back is ignored in the CFG.
-=head1 Parrot calling conventions
+=head1 Parrot calling conventions - CPS
Proposed syntax:
=head2 PASM Subroutines
- $P0 = new Sub # Continuation / ...
- .pcc_begin
- $I0 = addr _sub_label
- $P0 = $I0
+ newsub $P0, $P1, Sub, Continuation, _sub_label, ret_addr
+ ...
+ .pcc_begin prototyped|non_prototyped
.arg x # I5
.arg y # I6
.arg z # I7
- .pcc_call $P0 # r = _sub_label(x, y, z)
+ .pcc_call $P0, $P1 # r = _sub_label(x, y, z)
+ ret_addr:
.local int r # optional - new result var
.result r
.pcc_end
+ .pcc_sub _sub_label prototyped|non_prototyped
+ .param int a # I5
+ .param int b # I6
+ .param int c # I7
+ ...
+ .pcc_begin_return
+ .return xy # e.g. I5
+ .pcc_end_return
+ ...
+ .end
+
=head2 NCI
Proposed syntax:
$P0 = load_lib "libname"
$P1 = dlfunc $P0, "funcname", "signature"
+ ...
.nci_begin
.arg x # I5
.arg y # I6
.arg z # I7
- .pcc_call $P1 # r = funcname(x, y, z)
+ invoke $P1 # r = funcname(x, y, z)
.local int r # optional - new result var
.result r
.nci_end