home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / d / djdev108.zip / LIB / CRT0.S < prev    next >
Text File  |  1992-07-03  |  762b  |  59 lines

  1.  
  2. /*
  3. **    Called as start(argc, argv, envp)
  4. */
  5.  
  6.     .text
  7.     .globl    start
  8. start:
  9.     movl    %esi,___pid
  10.     movl    %edi,___transfer_buffer
  11.     movl    %ebx,_ScreenPrimary
  12.     movl    %ebp,_ScreenSecondary
  13.     xorl    %esi,%esi
  14.     xorl    %edi,%edi
  15.     xorl    %ebp,%ebp
  16.     xorl    %ebx,%ebx
  17.  
  18.     movl    %esp,%ebx
  19.     movl    8(%ebx),%eax
  20.     pushl    %eax
  21.     movl    %eax,_environ
  22.     pushl    4(%ebx)
  23.     pushl    (%ebx)
  24.     call    ___main
  25.     call    _main
  26.     addl    $12,%esp
  27.     pushl    %eax
  28.     call    _exit
  29.  
  30. exit_again:
  31.     movl    $0x4c00,%eax
  32.     int    $0x21
  33.     jmp    exit_again
  34.  
  35.     ret
  36.  
  37.     .data
  38.  
  39.     .globl    _environ
  40. _environ:
  41.     .long    0
  42.  
  43.     .globl    ___pid
  44. ___pid:
  45.     .long    0
  46.  
  47.     .globl    ___transfer_buffer
  48. ___transfer_buffer:
  49.     .long    0
  50.  
  51.     .globl    _ScreenPrimary
  52. _ScreenPrimary:
  53.     .long    0
  54.  
  55.     .globl    _ScreenSecondary
  56. _ScreenSecondary:
  57.     .long    0
  58.  
  59.