annotate lab4/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 (* All loads are killed by a procedure call *)
mike@0 2
mike@0 3 proc f(): integer;
mike@0 4 var x, y: integer;
mike@0 5 begin
mike@0 6 x := 3;
mike@0 7 y := x + 1;
mike@0 8 g();
mike@0 9 return x + 1
mike@0 10 end;
mike@0 11
mike@0 12 proc g(); begin end;
mike@0 13
mike@0 14 begin
mike@0 15 print_num(f()); newline()
mike@0 16 end.
mike@0 17
mike@0 18 (*<<
mike@0 19 4
mike@0 20 >>*)
mike@0 21
mike@0 22 (*[[
mike@0 23 @ picoPascal compiler output
mike@0 24 .include "fixup.s"
mike@0 25 .global pmain
mike@0 26
mike@0 27 @ proc f(): integer;
mike@0 28 .text
mike@0 29 _f:
mike@0 30 mov ip, sp
mike@0 31 stmfd sp!, {r4-r10, fp, ip, lr}
mike@0 32 mov fp, sp
mike@0 33 @ x := 3;
mike@0 34 mov r4, #3
mike@0 35 @ y := x + 1;
mike@0 36 add r5, r4, #1
mike@0 37 @ g();
mike@0 38 bl _g
mike@0 39 @ return x + 1
mike@0 40 add r0, r4, #1
mike@0 41 ldmfd fp, {r4-r10, fp, sp, pc}
mike@0 42 .ltorg
mike@0 43
mike@0 44 @ proc g(); begin end;
mike@0 45 _g:
mike@0 46 mov ip, sp
mike@0 47 stmfd sp!, {r4-r10, fp, ip, lr}
mike@0 48 mov fp, sp
mike@0 49 ldmfd fp, {r4-r10, fp, sp, pc}
mike@0 50 .ltorg
mike@0 51
mike@0 52 pmain:
mike@0 53 mov ip, sp
mike@0 54 stmfd sp!, {r4-r10, fp, ip, lr}
mike@0 55 mov fp, sp
mike@0 56 @ print_num(f()); newline()
mike@0 57 bl _f
mike@0 58 bl print_num
mike@0 59 bl newline
mike@0 60 ldmfd fp, {r4-r10, fp, sp, pc}
mike@0 61 .ltorg
mike@0 62
mike@0 63 @ End
mike@0 64 ]]*)