cvsuser 02/07/13 10:38:43
Modified: examples/assembly hanoi.pasm jump.pasm local_label.pasm
Log:
Changes from Simon Glover <[EMAIL PROTECTED]> to reflect recent changes
to the assembler.
Revision Changes Path
1.4 +7 -7 parrot/examples/assembly/hanoi.pasm
Index: hanoi.pasm
===================================================================
RCS file: /cvs/public/parrot/examples/assembly/hanoi.pasm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- hanoi.pasm 3 Jun 2002 20:42:46 -0000 1.3
+++ hanoi.pasm 13 Jul 2002 17:38:43 -0000 1.4
@@ -79,7 +79,7 @@
set P1, I0, I1 #P0=[[1,2,3,...],[0,0,0...],[0,0,0...]]
set P2, I0, 0
set P3, I0, 0
- inc I0, 1
+ inc I0
lt I0, I5, loop_populate
set I1, I5 # size
set I2, 0 # start_col
@@ -110,13 +110,13 @@
repeat S0, " ", I5
print S0
- inc I2, 1 # j++
+ inc I2 # j++
eq I2, 3, done_loop
print " | "
if 1, loop_cols # j < 3
done_loop:
print "\n"
- inc I1, 1 # i++
+ inc I1 # i++
lt I1, I0, loop_rows # i < size
print "\n"
ret
@@ -132,7 +132,7 @@
loop_find_start_row:
set I7, P1, I4 #I7 = array[start_col][i]
ne I7, 0, found_start_row
- inc I4, 1 # i++
+ inc I4 # i++
lt I4, I0, loop_find_start_row # i < size
found_start_row:
set I5, I4 #I5 = start_row = i
@@ -141,7 +141,7 @@
loop_find_dest_row:
set I8, P2, I4 #I8 = array[dest_col][i]
ne I8, 0, found_dest_row # if(array[dest_col][i])
- inc I4, 1 # i++
+ inc I4 # i++
lt I4, I0, loop_find_dest_row # i < size
found_dest_row:
sub I6, I4, 1 #I6 = dest_row = i - 1
@@ -162,7 +162,7 @@
ret
move_multiple:
save I1
- dec I1, 1
+ dec I1
save I4
save I3
save I2
@@ -187,7 +187,7 @@
save I4
save I3
save I2
- dec I1, 1
+ dec I1
set I5, I2
set I2, I4
set I4, I5
1.2 +3 -3 parrot/examples/assembly/jump.pasm
Index: jump.pasm
===================================================================
RCS file: /cvs/public/parrot/examples/assembly/jump.pasm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- jump.pasm 15 Oct 2001 21:37:07 -0000 1.1
+++ jump.pasm 13 Jul 2002 17:38:43 -0000 1.2
@@ -7,18 +7,18 @@
# This program is free software. It is subject to the same
# license as Perl itself.
#
-# $Id: jump.pasm,v 1.1 2001/10/15 21:37:07 gregor Exp $
+# $Id: jump.pasm,v 1.2 2002/07/13 17:38:43 tom Exp $
#
MAIN: print "Jump test.\n"
print "Jumping to subroutine...\n"
- set I1, 5
+ set_addr I1, SUB
jump I1
RET: print "Returned from subroutine!\n"
end
SUB: print "Entered subroutine...\n"
- set I2, -8
+ set_addr I2, RET
jump I2
1.2 +23 -13 parrot/examples/assembly/local_label.pasm
Index: local_label.pasm
===================================================================
RCS file: /cvs/public/parrot/examples/assembly/local_label.pasm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- local_label.pasm 15 Oct 2001 21:37:07 -0000 1.1
+++ local_label.pasm 13 Jul 2002 17:38:43 -0000 1.2
@@ -5,20 +5,30 @@
# This program is free software. It is subject to the same
# license as The Parrot Interpreter.
#
-# $Id: local_label.pasm,v 1.1 2001/10/15 21:37:07 gregor Exp $
+# $Id: local_label.pasm,v 1.2 2002/07/13 17:38:43 tom Exp $
#
-main: print "test 1\n"
- branch $ok
-$ng: print "ng 1\n"
+.macro MAIN ()
+ print "test 1\n"
+ branch .$ok
+.local $ng: print "ng 1\n"
branch test2
-$ok: print "ok 1\n"
+.local $ok: print "ok 1\n"
-test2: print "test 2\n"
- branch $ok
-$ng: print "ng 2\n"
+.endm
+
+.macro TEST2 ()
+test2:
+ print "test 2\n"
+ branch .$ok
+.local $ng: print "ng 2\n"
branch done
-$ok: print "ok 2\n"
+.local $ok: print "ok 2\n"
+
+.endm
+
+ .MAIN ()
+ .TEST2 ()
done: end