comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 (* Print a string *)
2
3 begin
4 print_string("Hello world!");
5 newline()
6 end.
7
8 (*<<
9 Hello world!
10 >>*)
11
12 (*[[
13 @ picoPascal compiler output
14 .include "fixup.s"
15 .global pmain
16
17 .text
18 pmain:
19 mov ip, sp
20 stmfd sp!, {r4-r10, fp, ip, lr}
21 mov fp, sp
22 @ print_string("Hello world!");
23 mov r1, #12
24 set r0, g1
25 bl print_string
26 @ newline()
27 bl newline
28 ldmfd fp, {r4-r10, fp, sp, pc}
29 .ltorg
30
31 .data
32 g1:
33 .byte 72, 101, 108, 108, 111, 32, 119, 111, 114, 108
34 .byte 100, 33
35 .byte 0
36 @ End
37 ]]*)