annotate ppc/test/nest.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(x: integer): integer; begin return 2*x end;
mike@0 2 begin print_num(f(f(3))); newline() end.
mike@0 3
mike@0 4 (*<<
mike@0 5 12
mike@0 6 >>*)
mike@0 7
mike@0 8 (*[[
mike@0 9 MODULE Main 0 0
mike@0 10 IMPORT Lib 0
mike@0 11 ENDHDR
mike@0 12
mike@0 13 PROC _f 0 0 0
mike@0 14 ! proc f(x: integer): integer; begin return 2*x end;
mike@0 15 CONST 2
mike@0 16 LDLW 16
mike@0 17 TIMES
mike@0 18 RETURNW
mike@0 19 END
mike@0 20
mike@0 21 PROC MAIN 0 0 0
mike@0 22 ! begin print_num(f(f(3))); newline() end.
mike@0 23 CONST 3
mike@0 24 CONST 0
mike@0 25 GLOBAL _f
mike@0 26 PCALLW 1
mike@0 27 CONST 0
mike@0 28 GLOBAL _f
mike@0 29 PCALLW 1
mike@0 30 CONST 0
mike@0 31 GLOBAL lib.print_num
mike@0 32 PCALL 1
mike@0 33 CONST 0
mike@0 34 GLOBAL lib.newline
mike@0 35 PCALL 0
mike@0 36 RETURN
mike@0 37 END
mike@0 38
mike@0 39 ! End
mike@0 40 ]]*)