annotate src/swis.s @ 1028:5044d9d784ed v7.0.154

updated for version 7.0-154
author vimboss
date Wed, 01 Nov 2006 11:44:31 +0000
parents 3fc0f57ecb91
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 ; Thomas Leonard
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 ; 24/5/98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 ar0 rn 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 ar1 rn 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 ar2 rn 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 ar3 rn 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 ar4 rn 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 ar5 rn 5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 ar6 rn 6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 ar7 rn 7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 ar10 rn 10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 ar11 rn 11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 lk rn 14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 ar15 rn 15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 AREA DATA
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 align 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 export |r0|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 r0: dcd 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 export |r1|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 r1: dcd 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 export |r2|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 r2: dcd 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 export |r3|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 r3: dcd 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 export |r4|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 r4: dcd 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 export |r5|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 r5: dcd 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 export |r6|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 r6: dcd 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 export |r7|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 r7: dcd 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 export |time_of_last_poll|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 time_of_last_poll: dcd 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 AREA CODE, READONLY
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 align 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 import |r0|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 export |swi|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 = "swi"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 align 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 swi:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 ; r0 = swi number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 stmfd sp!,{ar4-ar10,lk}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 orr ar10,ar0,#1<<17 ;always use the X form
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 mov ar0,ar1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 mov ar1,ar2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 mov ar2,ar3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 add ar3,sp,#4*8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 ldmia ar3,{ar3-ar7}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 swi 0x6f ; OS_CallASWI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 ldr ar10,regs_addr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 stmia ar10,{ar0-ar7}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 ldmvcfd sp!,{ar4-ar10,pc}^
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 ; report the error and quit on Cancel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 mov r1,#0x17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 adr r2,s_title
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 swi 0x400df ; Wimp_ReportError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 cmp r1,#1 ;OK selected?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 ldmeqfd sp!,{ar4-ar10,pc}^ ;yes - try to continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 swi 0x11 ;no - die (OS_Exit)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 s_title:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 = "Nasty error - Cancel to quit"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 align 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 export |xswi|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 = "xswi"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 align 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 xswi:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 ; r0 = swi number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 stmfd sp!,{ar4-ar10,lk}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 orr ar10,ar0,#1<<17 ;always use the X form
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 mov ar0,ar1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 mov ar1,ar2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 mov ar2,ar3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 add ar3,sp,#4*8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 ldmia ar3,{ar3-ar7}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 swi 0x6f ; OS_CallASWI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 ldr ar10,regs_addr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 stmia ar10,{ar0-ar7}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 mov ar0,#0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 orr ar0,ar0,ar15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 ldmfd sp!,{ar4-ar10,pc}^
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 regs_addr:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 dcd r0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 ; The Wimp_Poll swis have to be done specially because,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 ; for some reason, r13 sometimes gets corrupted by Wimp_Poll
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 ; (eg when running FileFind)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 AREA CODE, READONLY
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 align 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 import |time_of_last_poll|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 export |wimp_poll|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 = "wimp_poll"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 align 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 wimp_poll:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 mov ar3,sp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 swi 0x400c7 ; Wimp_Poll
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 mov sp,ar3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 mov ar3,ar0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 swi 0x42 ; OS_ReadMonotonicTime
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 ldr ar2,addr_time
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 str ar0,[ar2]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 mov ar0,ar3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 mov ar2,#0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 wfs ar2 ; Write floating point status. Needed?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 movs pc,lk
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 align 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 export |wimp_pollidle|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 = "wimp_pollidle"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 align 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 wimp_pollidle:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 mov ar3,sp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 swi 0x400e1 ; Wimp_PollIdle
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 mov sp,ar3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 mov ar3,ar0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 swi 0x42 ; OS_ReadMonotonicTime
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 ldr ar2,addr_time
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 str ar0,[ar2]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 mov ar0,ar3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 mov ar2,#0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 wfs ar2 ; Write floating point status. Needed?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 movs pc,lk
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 addr_time: dcd time_of_last_poll