annotate ppc/test/mult.p @ 1:b5139af1a420 tip basis

Fixed permissions on compile scripts
author Mike Spivey <mike@cs.ox.ac.uk>
date Fri, 13 Oct 2017 17:27:58 +0100
parents bfdcc3820b32
children
rev   line source
mike@0 1 var x, y, z: integer;
mike@0 2
mike@0 3 begin
mike@0 4 x := 3;
mike@0 5 y := 5;
mike@0 6 z := x * y;
mike@0 7 print_num(z);
mike@0 8 newline();
mike@0 9 end.
mike@0 10
mike@0 11 (*<<
mike@0 12 15
mike@0 13 >>*)
mike@0 14
mike@0 15 (*[[
mike@0 16 MODULE Main 0 0
mike@0 17 IMPORT Lib 0
mike@0 18 ENDHDR
mike@0 19
mike@0 20 PROC MAIN 0 0 0
mike@0 21 ! x := 3;
mike@0 22 CONST 3
mike@0 23 STGW _x
mike@0 24 ! y := 5;
mike@0 25 CONST 5
mike@0 26 STGW _y
mike@0 27 ! z := x * y;
mike@0 28 LDGW _x
mike@0 29 LDGW _y
mike@0 30 TIMES
mike@0 31 STGW _z
mike@0 32 ! print_num(z);
mike@0 33 LDGW _z
mike@0 34 CONST 0
mike@0 35 GLOBAL lib.print_num
mike@0 36 PCALL 1
mike@0 37 ! newline();
mike@0 38 CONST 0
mike@0 39 GLOBAL lib.newline
mike@0 40 PCALL 0
mike@0 41 ! end.
mike@0 42 RETURN
mike@0 43 END
mike@0 44
mike@0 45 GLOVAR _x 4
mike@0 46 GLOVAR _y 4
mike@0 47 GLOVAR _z 4
mike@0 48 ! End
mike@0 49 ]]*)