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