Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
145 halyavin 1
format ELF
2
section '.text' executable
3
extrn malloc
4
public _msys_start_thread
5
_msys_start_thread:
6
;arg1 - proc
7
;arg2 - stacksize
8
;arg3 - pid
9
  push  dword [esp+8]
10
  call  malloc
11
  test  eax,eax
12
  jz    .no_mem
13
  push  ebx
14
  mov   edx,eax
15
  add   edx,[esp+12]
16
  mov   [edx-4],dword 0
17
  mov   ecx,[esp+8]
18
  mov   ebx,1
19
  mov   eax,51
20
  int   0x40
21
  mov   ebx,[esp+16]
22
  test  ebx,ebx
23
  jz    .no_val
24
  mov   [ebx],eax
25
.no_val:
26
  mov   eax,edx
27
  sub   eax,[esp+12]
28
  pop   ebx
29
  ret   12
30
.no_mem:
31
  mov   ecx,[esp+12]
32
  mov   [ecx],eax
33
  ret   12