annotate lab4/test/record0.p @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
rev   line source
0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
1 (* Phone book using record type *)
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
3 const wordlen = 10;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
5 type string = array wordlen of char;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
6
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
7 type rec = record name: string; age: integer end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
8
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
9 var
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
10 db: array 20 of rec;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
11 N: integer;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
12
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
13 proc equal(x, y: string): boolean;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
14 var i: integer;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
15 begin
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
16 i := 0;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
17 while i < wordlen do
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
18 if x[i] <> y[i] then
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
19 return false
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
20 end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
21 i := i+1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
22 end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
23 return true
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
24 end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
25
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
26 proc copy(var dst: string; src: string);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
27 var i: integer;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
28 begin
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
29 i := 0;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
30 while i < wordlen do
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
31 dst[i] := src[i]; i := i+1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
32 end
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
33 end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
34
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
35 proc store(n: string; a: integer);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
36 begin
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
37 copy(db[N].name, n);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
38 db[N].age := a;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
39 N := N+1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
40 end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
41
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
42 proc recall(n: string): integer;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
43 var i: integer;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
44 begin
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
45 i := 0;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
46 while i < N do
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
47 if equal(db[i].name, n) then
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
48 return db[i].age
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
49 end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
50 i := i+1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
51 end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
52 return 999
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
53 end;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
54
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
55 begin
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
56 N := 0;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
57
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
58 store("bill ", 23);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
59 store("george ", 34);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
60
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
61 print_num(recall("george ")); newline();
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
62 print_num(recall("fred ")); newline()
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
63 end.
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
64
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
65 (*<<
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
66 34
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
67 999
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
68 >>*)
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
69
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
70 (*[[
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
71 @ picoPascal compiler output
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
72 .include "fixup.s"
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
73 .global pmain
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
74
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
75 @ proc equal(x, y: string): boolean;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
76 .text
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
77 _equal:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
78 mov ip, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
79 stmfd sp!, {r0-r1}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
80 stmfd sp!, {r4-r10, fp, ip, lr}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
81 mov fp, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
82 @ i := 0;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
83 mov r4, #0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
84 .L6:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
85 @ while i < wordlen do
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
86 cmp r4, #10
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
87 bge .L8
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
88 @ if x[i] <> y[i] then
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
89 ldr r0, [fp, #40]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
90 add r0, r0, r4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
91 ldrb r0, [r0]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
92 ldr r1, [fp, #44]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
93 add r1, r1, r4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
94 ldrb r1, [r1]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
95 cmp r0, r1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
96 beq .L11
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
97 @ return false
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
98 mov r0, #0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
99 b .L5
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
100 .L11:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
101 @ i := i+1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
102 add r4, r4, #1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
103 b .L6
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
104 .L8:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
105 @ return true
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
106 mov r0, #1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
107 .L5:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
108 ldmfd fp, {r4-r10, fp, sp, pc}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
109 .ltorg
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
110
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
111 @ proc copy(var dst: string; src: string);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
112 _copy:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
113 mov ip, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
114 stmfd sp!, {r0-r1}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
115 stmfd sp!, {r4-r10, fp, ip, lr}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
116 mov fp, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
117 @ i := 0;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
118 mov r4, #0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
119 .L13:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
120 @ while i < wordlen do
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
121 cmp r4, #10
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
122 bge .L12
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
123 @ dst[i] := src[i]; i := i+1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
124 ldr r0, [fp, #44]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
125 add r0, r0, r4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
126 ldrb r0, [r0]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
127 ldr r1, [fp, #40]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
128 add r1, r1, r4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
129 strb r0, [r1]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
130 add r4, r4, #1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
131 b .L13
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
132 .L12:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
133 ldmfd fp, {r4-r10, fp, sp, pc}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
134 .ltorg
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
135
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
136 @ proc store(n: string; a: integer);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
137 _store:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
138 mov ip, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
139 stmfd sp!, {r0-r1}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
140 stmfd sp!, {r4-r10, fp, ip, lr}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
141 mov fp, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
142 @ copy(db[N].name, n);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
143 ldr r1, [fp, #40]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
144 set r0, _db
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
145 set r2, _N
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
146 ldr r2, [r2]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
147 lsl r2, r2, #4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
148 add r0, r0, r2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
149 bl _copy
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
150 @ db[N].age := a;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
151 set r4, _N
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
152 ldr r0, [fp, #44]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
153 set r1, _db
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
154 ldr r2, [r4]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
155 lsl r2, r2, #4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
156 add r1, r1, r2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
157 str r0, [r1, #12]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
158 @ N := N+1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
159 ldr r0, [r4]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
160 add r0, r0, #1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
161 str r0, [r4]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
162 ldmfd fp, {r4-r10, fp, sp, pc}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
163 .ltorg
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
164
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
165 @ proc recall(n: string): integer;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
166 _recall:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
167 mov ip, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
168 stmfd sp!, {r0-r1}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
169 stmfd sp!, {r4-r10, fp, ip, lr}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
170 mov fp, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
171 @ i := 0;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
172 mov r4, #0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
173 .L18:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
174 @ while i < N do
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
175 set r0, _N
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
176 ldr r0, [r0]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
177 cmp r4, r0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
178 bge .L20
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
179 @ if equal(db[i].name, n) then
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
180 ldr r1, [fp, #40]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
181 set r0, _db
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
182 lsl r2, r4, #4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
183 add r0, r0, r2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
184 bl _equal
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
185 cmp r0, #0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
186 beq .L23
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
187 @ return db[i].age
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
188 set r0, _db
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
189 lsl r1, r4, #4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
190 add r0, r0, r1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
191 ldr r0, [r0, #12]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
192 b .L17
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
193 .L23:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
194 @ i := i+1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
195 add r4, r4, #1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
196 b .L18
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
197 .L20:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
198 @ return 999
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
199 set r0, #999
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
200 .L17:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
201 ldmfd fp, {r4-r10, fp, sp, pc}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
202 .ltorg
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
203
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
204 pmain:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
205 mov ip, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
206 stmfd sp!, {r4-r10, fp, ip, lr}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
207 mov fp, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
208 @ N := 0;
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
209 mov r0, #0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
210 set r1, _N
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
211 str r0, [r1]
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
212 @ store("bill ", 23);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
213 mov r1, #23
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
214 set r0, g1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
215 bl _store
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
216 @ store("george ", 34);
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
217 mov r1, #34
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
218 set r0, g2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
219 bl _store
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
220 @ print_num(recall("george ")); newline();
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
221 set r0, g3
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
222 bl _recall
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
223 bl print_num
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
224 bl newline
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
225 @ print_num(recall("fred ")); newline()
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
226 set r0, g4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
227 bl _recall
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
228 bl print_num
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
229 bl newline
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
230 ldmfd fp, {r4-r10, fp, sp, pc}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
231 .ltorg
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
232
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
233 .comm _db, 320, 4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
234 .comm _N, 4, 4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
235 .data
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
236 g1:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
237 .byte 98, 105, 108, 108, 32, 32, 32, 32, 32, 32
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
238 .byte 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
239 g2:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
240 .byte 103, 101, 111, 114, 103, 101, 32, 32, 32, 32
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
241 .byte 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
242 g3:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
243 .byte 103, 101, 111, 114, 103, 101, 32, 32, 32, 32
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
244 .byte 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
245 g4:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
246 .byte 102, 114, 101, 100, 32, 32, 32, 32, 32, 32
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
247 .byte 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
248 @ End
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
249 ]]*)