comparison lab4/test/locarray.p @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 (* Local array *)
2
3 proc P();
4 var i: integer; x: integer; a: array 10 of integer;
5 begin
6 i := 0;
7 x := a[i]
8 end;
9
10 begin
11 P()
12 end.
13
14 (*[[
15 @ picoPascal compiler output
16 .include "fixup.s"
17 .global pmain
18
19 @ proc P();
20 .text
21 _P:
22 mov ip, sp
23 stmfd sp!, {r4-r10, fp, ip, lr}
24 mov fp, sp
25 sub sp, sp, #40
26 @ i := 0;
27 mov r4, #0
28 @ x := a[i]
29 add r0, fp, #-40
30 lsl r1, r4, #2
31 add r0, r0, r1
32 ldr r5, [r0]
33 ldmfd fp, {r4-r10, fp, sp, pc}
34 .ltorg
35
36 pmain:
37 mov ip, sp
38 stmfd sp!, {r4-r10, fp, ip, lr}
39 mov fp, sp
40 @ P()
41 bl _P
42 ldmfd fp, {r4-r10, fp, sp, pc}
43 .ltorg
44
45 @ End
46 ]]*)