Subversion Repositories Kolibri OS

Rev

Rev 5098 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. CATCH_NULL_CALL = 0
  2.  
  3. format MS COFF
  4. section '.text' code readable executable
  5. public start
  6. ;EXTRN _edata
  7. EXTRN ___menuet__app_param_area
  8. EXTRN ___menuet__app_path_area
  9. EXTRN ___crt1_startup
  10. EXTRN ___memsize
  11. start:
  12. public ___menuet__app_header
  13. public ___menuet__memsize
  14. section '.A' code readable executable
  15. ___menuet__app_header:
  16.  db 'MENUET01'
  17.  dd 0x01
  18.  dd do_start
  19. ; dd _edata
  20.  dd 0
  21. ___menuet__memsize:
  22.  dd ___memsize
  23.  dd app_stack
  24.  dd ___menuet__app_param_area
  25.  dd ___menuet__app_path_area
  26.  
  27. do_start:
  28.         push    68
  29.         pop     eax
  30.         push    11
  31.         pop     ebx
  32.         push    eax
  33.         int     0x40
  34.         pop     eax
  35.         inc     ebx
  36.         mov     ecx, 0x100000
  37.         int     0x40
  38.         lea     esp, [eax+ecx]
  39. if CATCH_NULL_CALL
  40.         mov     byte [0], 0xE9
  41.         mov     dword [1], _libc_null_call-5
  42. end if
  43.  jmp ___crt1_startup
  44.  
  45. if CATCH_NULL_CALL
  46. EXTRN ___libc_null_call
  47.  
  48. _libc_null_call:
  49.     push eax
  50.     push ebx
  51.     push ecx
  52.     push edx
  53.     push esi
  54.     push edi
  55.     push ebp
  56.     call ___libc_null_call
  57.     mov eax,-1
  58.     int 0x40
  59. end if
  60.  
  61. section '.bss' readable writeable
  62. rb 0x100
  63. app_stack:
  64.