comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 var x, y, z: integer;
2
3 begin
4 x := 3;
5 y := 5;
6 z := x * y;
7 print_num(z);
8 newline();
9 end.
10
11 (*<<
12 15
13 >>*)
14
15 (*[[
16 MODULE Main 0 0
17 IMPORT Lib 0
18 ENDHDR
19
20 PROC MAIN 0 0 0
21 ! x := 3;
22 CONST 3
23 STGW _x
24 ! y := 5;
25 CONST 5
26 STGW _y
27 ! z := x * y;
28 LDGW _x
29 LDGW _y
30 TIMES
31 STGW _z
32 ! print_num(z);
33 LDGW _z
34 CONST 0
35 GLOBAL lib.print_num
36 PCALL 1
37 ! newline();
38 CONST 0
39 GLOBAL lib.newline
40 PCALL 0
41 ! end.
42 RETURN
43 END
44
45 GLOVAR _x 4
46 GLOVAR _y 4
47 GLOVAR _z 4
48 ! End
49 ]]*)