annotate lab4/test/string.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 (* Print a string *)
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("Hello world!");
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
5 newline()
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
6 end.
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
7
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
8 (*<<
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
9 Hello world!
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 (*[[
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
13 @ picoPascal compiler output
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
14 .include "fixup.s"
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
15 .global pmain
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
16
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
17 .text
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
18 pmain:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
19 mov ip, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
20 stmfd sp!, {r4-r10, fp, ip, lr}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
21 mov fp, sp
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
22 @ print_string("Hello world!");
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
23 mov r1, #12
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
24 set r0, g1
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
25 bl print_string
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
26 @ newline()
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
27 bl newline
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
28 ldmfd fp, {r4-r10, fp, sp, pc}
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
29 .ltorg
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
30
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
31 .data
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
32 g1:
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
33 .byte 72, 101, 108, 108, 111, 32, 119, 111, 114, 108
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
34 .byte 100, 33
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
35 .byte 0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
36 @ End
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
37 ]]*)