annotate lab4/test/print5.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 strings *)
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_string("five"); 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 five
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_string("five"); newline()
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
22 mov r1, #4
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
23 set r0, g1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
24 bl print_string
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
25 bl newline
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
26 ldmfd fp, {r4-r10, fp, sp, pc}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
27 .ltorg
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
28
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
29 .data
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
30 g1:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
31 .byte 102, 105, 118, 101
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
32 .byte 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
33 @ End
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
34 ]]*)