annotate lab4/test/string.p @ 1:b5139af1a420 tip basis

Fixed permissions on compile scripts
author Mike Spivey <mike@cs.ox.ac.uk>
date Fri, 13 Oct 2017 17:27:58 +0100
parents bfdcc3820b32
children
rev   line source
mike@0 1 (* Print a string *)
mike@0 2
mike@0 3 begin
mike@0 4 print_string("Hello world!");
mike@0 5 newline()
mike@0 6 end.
mike@0 7
mike@0 8 (*<<
mike@0 9 Hello world!
mike@0 10 >>*)
mike@0 11
mike@0 12 (*[[
mike@0 13 @ picoPascal compiler output
mike@0 14 .include "fixup.s"
mike@0 15 .global pmain
mike@0 16
mike@0 17 .text
mike@0 18 pmain:
mike@0 19 mov ip, sp
mike@0 20 stmfd sp!, {r4-r10, fp, ip, lr}
mike@0 21 mov fp, sp
mike@0 22 @ print_string("Hello world!");
mike@0 23 mov r1, #12
mike@0 24 set r0, g1
mike@0 25 bl print_string
mike@0 26 @ newline()
mike@0 27 bl newline
mike@0 28 ldmfd fp, {r4-r10, fp, sp, pc}
mike@0 29 .ltorg
mike@0 30
mike@0 31 .data
mike@0 32 g1:
mike@0 33 .byte 72, 101, 108, 108, 111, 32, 119, 111, 114, 108
mike@0 34 .byte 100, 33
mike@0 35 .byte 0
mike@0 36 @ End
mike@0 37 ]]*)