annotate lab4/test/print.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 (* Printing numbers *)
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
3 begin
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
4 print_num(2); newline()
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
5 end.
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
6
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
7 (*<<
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
8 2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
9 >>*)
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
10
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
11 (*[[
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
12 @ picoPascal compiler output
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
13 .include "fixup.s"
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
14 .global pmain
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
15
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
16 .text
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
17 pmain:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
18 mov ip, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
19 stmfd sp!, {r4-r10, fp, ip, lr}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
20 mov fp, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
21 @ print_num(2); newline()
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
22 mov r0, #2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
23 bl print_num
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
24 bl newline
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
25 ldmfd fp, {r4-r10, fp, sp, pc}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
26 .ltorg
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
27
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
28 @ End
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
29 ]]*)