-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHelloOS.s
72 lines (52 loc) · 1.42 KB
/
HelloOS.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
; HelloOS test file for COMS35102 Advanced OS
; uses nested processes, that need to be supported by the OS
AREA HelloOSTest, CODE, READONLY
EXPORT HelloOS ; symbol for linking to the OS
HelloOS
ADR r0, HelloOStext
SVC 0x04; print zero-terminated string
ADR r0, HelloWorld
SVC 0x05 ; create process
ADR r0, HelloOSdone
SVC 0x04
SVC 0x00 ; terminate process
HelloWorld
ADR r0, Hellotext
SVC 0x04 ; print zero-terminated string
ADR r0, HelloMars
SVC 0x05 ; create nested process
ADR r0, Hellodone
SVC 0x04
SVC 0x00 ; terminate process
HelloMars
ADR r0, HelloMtext
SVC 0x04 ; print zero-terminated string
ADR r0, HelloGalaxy
SVC 0x05 ; create nested process
ADR r0, HelloMdone
SVC 0x04
SVC 0x00 ; terminate process
HelloGalaxy
ADR r0, HelloGtext
SVC 0x04 ; print zero-terminated string
ADR r0, HelloGdone
SVC 0x04
SVC 0x00 ; terminate process
; DATA CONSTANTS
HelloOStext
DCB "\nHelloOS assembly test routine starting...\n",0
Hellotext
DCB "\nHello World!",0
HelloMtext
DCB "\nHello Mars!",0
HelloGtext
DCB "\nHello Galaxy!",0
HelloOSdone
DCB "\nHelloOS assembly test routine finished :)\n",0
Hellodone
DCB "\nHello World done",0
HelloMdone
DCB "\nHello Mars done",0
HelloGdone
DCB "\nHello Galaxy done",0
END