annotate ppc/test/recrec.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 type r = record x: integer; q: record y, z: integer; end; end;
mike@0 2
mike@0 3 var m: r;
mike@0 4
mike@0 5 begin
mike@0 6 m.x := 2; m.q.y := 3; m.q.z := 4;
mike@0 7 print_num(m.x+m.q.y+m.q.z); newline()
mike@0 8 end.
mike@0 9
mike@0 10 (*<<
mike@0 11 9
mike@0 12 >>*)
mike@0 13
mike@0 14 (*[[
mike@0 15 MODULE Main 0 0
mike@0 16 IMPORT Lib 0
mike@0 17 ENDHDR
mike@0 18
mike@0 19 PROC MAIN 0 0 0
mike@0 20 ! m.x := 2; m.q.y := 3; m.q.z := 4;
mike@0 21 CONST 2
mike@0 22 STGW _m
mike@0 23 CONST 3
mike@0 24 GLOBAL _m
mike@0 25 STNW 4
mike@0 26 CONST 4
mike@0 27 GLOBAL _m
mike@0 28 STNW 8
mike@0 29 ! print_num(m.x+m.q.y+m.q.z); newline()
mike@0 30 LDGW _m
mike@0 31 GLOBAL _m
mike@0 32 LDNW 4
mike@0 33 PLUS
mike@0 34 GLOBAL _m
mike@0 35 LDNW 8
mike@0 36 PLUS
mike@0 37 CONST 0
mike@0 38 GLOBAL lib.print_num
mike@0 39 PCALL 1
mike@0 40 CONST 0
mike@0 41 GLOBAL lib.newline
mike@0 42 PCALL 0
mike@0 43 RETURN
mike@0 44 END
mike@0 45
mike@0 46 GLOVAR _m 12
mike@0 47 ! End
mike@0 48 ]]*)