[svn:parrot] r37627 - trunk/docs
cotto at svn.parrot.org
cotto at svn.parrot.org
Sun Mar 22 00:02:13 UTC 2009
Author: cotto
Date: Sun Mar 22 00:02:13 2009
New Revision: 37627
URL: https://trac.parrot.org/parrot/changeset/37627
Log:
[docs] PIR docs clarification, courtesy of lucs++
Modified:
trunk/docs/intro.pod
Modified: trunk/docs/intro.pod
==============================================================================
--- trunk/docs/intro.pod Sat Mar 21 21:36:23 2009 (r37626)
+++ trunk/docs/intro.pod Sun Mar 22 00:02:13 2009 (r37627)
@@ -202,24 +202,18 @@
=begin PIR
.sub main
- set $S0, "Hello world!\n"
- print $S0
- .end
-
-=end PIR
-
-This sample shows the explicit use of the C<set> opcode. PIR
-provides some syntactic relief here with the C<=> operator.
-
-=begin PIR
-
- .sub main
$S0 = "Hello world!\n"
print $S0
.end
=end PIR
+PIR does not allow us to set a register directly. We need to prefix the
+register name with C<$> when referring to a register. The compiler will map $S0
+to one of the available string registers, for example S0, and set the value.
+This example also uses the syntactic sugar provided by the C<=> operator. C<=>
+is simply a more readable way of using the C<set> opcode.
+
To make PIR even more readable, named registers can be used. These are later
mapped to real numbered registers.
More information about the parrot-commits
mailing list