diff ppc/test/mult.p @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ppc/test/mult.p	Thu Oct 05 08:04:15 2017 +0100
@@ -0,0 +1,49 @@
+var x, y, z: integer;
+
+begin
+  x := 3;
+  y := 5;
+  z := x * y;
+  print_num(z);
+  newline();
+end.
+
+(*<<
+15
+>>*)
+
+(*[[
+MODULE Main 0 0
+IMPORT Lib 0
+ENDHDR
+
+PROC MAIN 0 0 0
+!   x := 3;
+CONST 3
+STGW _x
+!   y := 5;
+CONST 5
+STGW _y
+!   z := x * y;
+LDGW _x
+LDGW _y
+TIMES
+STGW _z
+!   print_num(z);
+LDGW _z
+CONST 0
+GLOBAL lib.print_num
+PCALL 1
+!   newline();
+CONST 0
+GLOBAL lib.newline
+PCALL 0
+! end.
+RETURN
+END
+
+GLOVAR _x 4
+GLOVAR _y 4
+GLOVAR _z 4
+! End
+]]*)