Subversion Repositories Kolibri OS

Rev

Rev 3245 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3245 Rev 8637
Line 5... Line 5...
5
SC_GETC = 4
5
SC_GETC = 4
6
SC_GETS = 5
6
SC_GETS = 5
7
SC_CLS	= 6
7
SC_CLS	= 6
8
 
8
SC_PID = 7
9
SHM_WRITE =  0x01
9
SC_PING = 8
-
 
10
 
-
 
11
SHM_WRITE =  0x01
Line 10... Line 12...
10
SHM_OPEN_ALWAYS = 0x04
12
SHM_OPEN_ALWAYS = 0x04
11
 
13
 
Line 12... Line 14...
12
;============================
14
;============================
Line 19... Line 21...
19
 
21
 
20
;============================
22
;============================
Line 21... Line 23...
21
 
23
 
Line -... Line 24...
-
 
24
if used _sc_pid2name
22
align 4
25
align 4
23
_sc_pid2name:
26
_sc_pid2name:
Line 24... Line 27...
24
 
27
 
25
 push esp
28
 push esp
Line 65... Line 68...
65
 pop esp
68
 pop esp
66
 
69
 
Line 67... Line 70...
67
 ret
70
 ret
-
 
71
end if
Line 68... Line 72...
68
 
72
 
Line -... Line 73...
-
 
73
;============================
69
;============================
74
 
70
 
75
if used _sc_init
71
align 4
76
align 4
Line 72... Line 77...
72
; void __stdcall sc_init();
77
; void __stdcall sc_init();
Line 114... Line 119...
114
 pop esp
119
 pop esp
115
 
120
 
Line 116... Line 121...
116
 ret
121
 ret
-
 
122
end if
Line 117... Line 123...
117
 
123
 
Line -... Line 124...
-
 
124
;============================
118
;============================
125
 
119
 
126
if used _sc_puts
120
align 4
127
align 4
Line 121... Line 128...
121
; void __stdcall sc_puts(char *str);
128
; void __stdcall sc_puts(char *str);
Line 153... Line 160...
153
 pop ebx
160
 pop ebx
Line 154... Line 161...
154
 pop esp
161
 pop esp
155
 ret 4
162
 ret 4
156
 
163
end if
-
 
164
 
Line 157... Line 165...
157
;============================
165
;============================
Line -... Line 166...
-
 
166
 
158
 
167
if used _sc_exit
159
align 4
168
align 4
160
; void __stdcall sc_exit();
169
; void __stdcall sc_exit();
161
_sc_exit:
170
_sc_exit:
162
 push ebx
171
 push ebx
Line 185... Line 194...
185
 pop esp
194
 pop esp
Line 186... Line 195...
186
 pop ebx
195
 pop ebx
187
 ret
196
 ret
188
 
197
end if
-
 
198
 
Line 189... Line 199...
189
 
199
 
Line -... Line 200...
-
 
200
;============================
190
;============================
201
 
191
 
202
if used _sc_gets
192
align 4
203
align 4
Line 193... Line 204...
193
; void __stdcall sc_gets(char *str);
204
; void __stdcall sc_gets(char *str);
Line 227... Line 238...
227
 pop ebx
238
 pop ebx
Line 228... Line 239...
228
 pop esp
239
 pop esp
229
 ret 4
240
 ret 4
230
 
241
end if
-
 
242
 
Line 231... Line 243...
231
;============================
243
;============================
Line -... Line 244...
-
 
244
 
-
 
245
if used _sc_pid
-
 
246
_sc_pid:
-
 
247
;int __stdcall sc_pid (void);
-
 
248
	push	ebx ecx
-
 
249
 
-
 
250
	mov	ecx, [sc_buffer]
-
 
251
	mov	byte [ecx], SC_PID
-
 
252
 
-
 
253
@@:
-
 
254
	mov	eax, 5
-
 
255
	mov	ebx, 5
-
 
256
	int	0x40
-
 
257
 
-
 
258
	cmp	byte [ecx], 0
-
 
259
	je	@f
-
 
260
	call	_sc_ping
-
 
261
	test	eax, eax
-
 
262
	jnz	.err
-
 
263
 
-
 
264
@@:
-
 
265
	mov	eax, [ecx+1]
-
 
266
	pop	ecx ebx
-
 
267
	ret
-
 
268
 
-
 
269
.err:
-
 
270
	pop	ecx ebx
-
 
271
	xor	eax, eax
-
 
272
	dec	eax
-
 
273
	ret
-
 
274
end if
-
 
275
 
-
 
276
;============================
-
 
277
 
-
 
278
if used _sc_ping
-
 
279
_sc_ping:
-
 
280
;int __stdcall sc_ping (void);
-
 
281
	push	ebx ecx
-
 
282
 
-
 
283
	mov	ecx, [sc_buffer]
-
 
284
	mov	byte [ecx], SC_PING
-
 
285
 
-
 
286
	mov	eax, 5
-
 
287
	mov	ebx, 200
-
 
288
	int	0x40
-
 
289
 
-
 
290
	xor	eax, eax
-
 
291
	cmp	byte [ecx], 0
-
 
292
	je	@f
-
 
293
	dec	eax
-
 
294
 
-
 
295
@@:
-
 
296
	pop	ecx ebx
-
 
297
	ret