cvsuser 03/07/17 13:10:55
Modified: examples/assembly hanoi.pasm life.pasm uniq.pasm
Log:
Some minor fixes to get things to run
Revision Changes Path
1.7 +10 -2 parrot/examples/assembly/hanoi.pasm
Index: hanoi.pasm
===================================================================
RCS file: /cvs/public/parrot/examples/assembly/hanoi.pasm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- hanoi.pasm 3 Jan 2003 15:19:37 -0000 1.6
+++ hanoi.pasm 17 Jul 2003 20:10:54 -0000 1.7
@@ -11,7 +11,7 @@
#
# The towers are arrays of integers. 0 indicates no disk is present
# A positive integer indicates the diameter of the disk occupying
-# the inicated slot.
+# the indicated slot.
#
# So this setup
#
@@ -64,7 +64,11 @@
# }
MAIN:
- set I5, P0[1] #I5 = argv[0]
+ set I0, P0
+ lt I0, 2, ERROR
+
+ set S5, P0[1] # S5 = argv[0]
+ set I5, S5 # Convert to an int
new P0, .PerlArray
new P1, .PerlArray
new P2, .PerlArray
@@ -197,4 +201,8 @@
restore I4
restore I1
ret
+
+ERROR: print "Error: no size specified for tower\n"
+ end
+
1.18 +1 -1 parrot/examples/assembly/life.pasm
Index: life.pasm
===================================================================
RCS file: /cvs/public/parrot/examples/assembly/life.pasm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- life.pasm 11 Jul 2003 17:49:50 -0000 1.17
+++ life.pasm 17 Jul 2003 20:10:54 -0000 1.18
@@ -47,7 +47,7 @@
inc I0
mod I31,I0,100
if I31, skip
- print 2,"."
+ printerr "."
skip:
bsr generate
1.3 +4 -4 parrot/examples/assembly/uniq.pasm
Index: uniq.pasm
===================================================================
RCS file: /cvs/public/parrot/examples/assembly/uniq.pasm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- uniq.pasm 8 Jul 2003 13:01:19 -0000 1.2
+++ uniq.pasm 17 Jul 2003 20:10:54 -0000 1.3
@@ -1,4 +1,4 @@
-# $Id: uniq.pasm,v 1.2 2003/07/08 13:01:19 leo Exp $
+# $Id: uniq.pasm,v 1.3 2003/07/17 20:10:54 scog Exp $
# uniq - Remove duplicate lines from a sorted file
#
# % ./assemble.pl uniq.pasm -o uniq.pbc
@@ -19,8 +19,8 @@
#
# By Leon Brocard <[EMAIL PROTECTED]>
- set S0, P0[1]
- if S0, SOURCE
+ set I0, P0
+ ne I0, 1, SOURCE
set S0, P0[0]
print "usage: parrot "
print S0
@@ -106,6 +106,6 @@
LOOP:
set S2, S1
if S1, SOURCE_LOOP
- close I0
+ close P1
end