annotate ppc/test/recrec.p @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
rev   line source
0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
1 type r = record x: integer; q: record y, z: integer; end; end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
3 var m: r;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
5 begin
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
6 m.x := 2; m.q.y := 3; m.q.z := 4;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
7 print_num(m.x+m.q.y+m.q.z); newline()
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
8 end.
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
9
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
10 (*<<
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
11 9
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
12 >>*)
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
13
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
14 (*[[
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
15 MODULE Main 0 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
16 IMPORT Lib 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
17 ENDHDR
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
18
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
19 PROC MAIN 0 0 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
20 ! m.x := 2; m.q.y := 3; m.q.z := 4;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
21 CONST 2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
22 STGW _m
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
23 CONST 3
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
24 GLOBAL _m
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
25 STNW 4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
26 CONST 4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
27 GLOBAL _m
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
28 STNW 8
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
29 ! print_num(m.x+m.q.y+m.q.z); newline()
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
30 LDGW _m
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
31 GLOBAL _m
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
32 LDNW 4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
33 PLUS
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
34 GLOBAL _m
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
35 LDNW 8
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
36 PLUS
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
37 CONST 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
38 GLOBAL lib.print_num
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
39 PCALL 1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
40 CONST 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
41 GLOBAL lib.newline
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
42 PCALL 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
43 RETURN
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
44 END
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
45
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
46 GLOVAR _m 12
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
47 ! End
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
48 ]]*)