/ systhrea.s (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes

#if defined (__MT__)

        .globl  __sys_thread

        .text

        .align  2, 0x90

__sys_thread:
        fs
        movl    12, %eax                /* ptib2 */
        movl    0(%eax), %edx           /* TID */
        movl    __sys_thread_table(,%edx,4), %eax
        testl   %eax, %eax
        jz      1f
        ret

        .align  2, 0x90
1:      pushl   %edx
        pushl   $0                      /* errnop */
        pushl   %edx                    /* tid */
        call    ___sys_newthread
        addl    $4, %esp
        popl    %edx
        movl    __sys_thread_table(,%edx,4), %eax
        ret

#endif
