annotate ppc/test/memkill.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 proc f(): integer;
mike@0 2 var x, y: integer;
mike@0 3 begin
mike@0 4 x := 3;
mike@0 5 y := x + 1;
mike@0 6 g();
mike@0 7 return x + 1
mike@0 8 end;
mike@0 9
mike@0 10 proc g(); begin end;
mike@0 11
mike@0 12 begin
mike@0 13 print_num(f()); newline()
mike@0 14 end.
mike@0 15
mike@0 16 (*<<
mike@0 17 4
mike@0 18 >>*)
mike@0 19
mike@0 20 (*[[
mike@0 21 MODULE Main 0 0
mike@0 22 IMPORT Lib 0
mike@0 23 ENDHDR
mike@0 24
mike@0 25 PROC _f 8 0 0
mike@0 26 ! x := 3;
mike@0 27 CONST 3
mike@0 28 STLW -4
mike@0 29 ! y := x + 1;
mike@0 30 LDLW -4
mike@0 31 CONST 1
mike@0 32 PLUS
mike@0 33 STLW -8
mike@0 34 ! g();
mike@0 35 CONST 0
mike@0 36 GLOBAL _g
mike@0 37 PCALL 0
mike@0 38 ! return x + 1
mike@0 39 LDLW -4
mike@0 40 CONST 1
mike@0 41 PLUS
mike@0 42 RETURNW
mike@0 43 END
mike@0 44
mike@0 45 PROC _g 0 0 0
mike@0 46 ! proc g(); begin end;
mike@0 47 RETURN
mike@0 48 END
mike@0 49
mike@0 50 PROC MAIN 0 0 0
mike@0 51 ! print_num(f()); newline()
mike@0 52 CONST 0
mike@0 53 GLOBAL _f
mike@0 54 PCALLW 0
mike@0 55 CONST 0
mike@0 56 GLOBAL lib.print_num
mike@0 57 PCALL 1
mike@0 58 CONST 0
mike@0 59 GLOBAL lib.newline
mike@0 60 PCALL 0
mike@0 61 RETURN
mike@0 62 END
mike@0 63
mike@0 64 ! End
mike@0 65 ]]*)