home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / emu387 / emuinit.s < prev    next >
Encoding:
Text File  |  1993-11-21  |  1.0 KB  |  64 lines

  1. /*
  2. ** If this is a standalone build, the starting EIP must point to _emu387
  3. ** and go32 will install the interrupt vector itself.
  4. */
  5.     .data
  6.  
  7.     .comm    _eax,4
  8.     .comm    _ebx,4
  9.     .comm    _ecx,4
  10.     .comm    _edx,4
  11.     .comm    _esi,4
  12.     .comm    _edi,4
  13.     .comm    _ebp,4
  14.     .comm    _esp,4
  15.     .comm    _eip,4
  16.  
  17.     .text
  18.  
  19.     .globl    _emu387
  20. _emu387:
  21.     movl    %eax,_eax
  22.     movl    %ebx,_ebx
  23.     movl    %ecx,_ecx
  24.     movl    %edx,_edx
  25.     movl    %esi,_esi
  26.     movl    %edi,_edi
  27.     movl    %ebp,_ebp
  28.  
  29.     movl    %esp,_esp
  30.     add    $12,_esp
  31.     pushl    %ebp
  32.     movl    %esp,%ebp
  33.  
  34.     movl    4(%ebp),%eax
  35.     movl    %eax,_eip
  36.     call    _emu_entry__Fv
  37.     movl    _eip,%eax
  38.     movl    %eax,4(%ebp)
  39.     movl    _eax,%eax
  40.     movl    _ebx,%ebx
  41.     movl    _ecx,%ecx
  42.     movl    _edx,%edx
  43.     movl    _esi,%esi
  44.     movl    _edi,%edi
  45.     popl    %ebp
  46.     andl    $0xfffeffff,8(%esp)
  47.     iret
  48.  
  49.     .globl    _emu_install__Fv
  50. _emu_install__Fv:
  51.     movw    $16,%ax
  52.     movw    %ax,%gs
  53.     movl    $_emu387,%ecx
  54.     movl    $56,%eax    /* vector 7 * 8 bpv */
  55.     movw    %cx,%gs:(%eax)
  56.     movw    %cs,%cx
  57.     movw    %cx,%gs:2(%eax)
  58.     movw    $0x8f00,%gs:4(%eax)
  59.     rorl    $16,%ecx
  60.     movw    %cx,%gs:6(%eax)
  61.     movw    %ds,%ax
  62.     movw    %ax,%gs
  63.     ret
  64.