[svn:parrot] r38241 - trunk/docs/book

cotto at svn.parrot.org cotto at svn.parrot.org
Tue Apr 21 05:49:02 UTC 2009


Author: cotto
Date: Tue Apr 21 05:49:00 2009
New Revision: 38241
URL: https://trac.parrot.org/parrot/changeset/38241

Log:
[book] fix some code examples

Modified:
   trunk/docs/book/ch09_pasm.pod

Modified: trunk/docs/book/ch09_pasm.pod
==============================================================================
--- trunk/docs/book/ch09_pasm.pod	Mon Apr 20 23:56:39 2009	(r38240)
+++ trunk/docs/book/ch09_pasm.pod	Tue Apr 21 05:49:00 2009	(r38241)
@@ -126,6 +126,8 @@
 
   =cut
 
+  end
+
 =end PASM
 
 Besides POD, there are also ordinary 1-line comments using the # sign,
@@ -222,8 +224,8 @@
 =begin PIR
 
   .sub 'foo'
-      $I33 = 1;
-  .return
+      $I33 = 1
+  .end
 
 =end PIR
 
@@ -234,7 +236,8 @@
 =begin PASM
 
   foo:
-      I33 = 1
+      set I33, 1
+  end
 
 =end PASM
 
@@ -2060,17 +2063,18 @@
 
 =begin PASM
 
-    loadlib P1, "libnci"          # get library object for a shared lib
+    loadlib P1, "libnci_test"     # get library object for a shared lib
     print "loaded\n"
     dlfunc P0, P1, "nci_dd", "dd" # obtain the function object
     print "dlfunced\n"
     set I0, 1                     # prototype used - unchecked
-    set N5, 4.0                   # first argument
-    invoke                        # call nci_dd
+    set_args "0", 4.0             # set the argument
+    get_results "0", N5           # prepare to store the return value
+    invokecc P0                   # call nci_dd
     ne N5, 8.0, nok_1             # the test functions returns 2*arg
     print "ok 1\n"
     end
-  nok_1:
+    nok_1:
     #...
 
 =end PASM


More information about the parrot-commits mailing list