home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / libcvers.zip / article_appendix / wat16fp.asm < prev    next >
Assembly Source File  |  2001-11-09  |  2KB  |  76 lines

  1. ; $Id: wat16fp.asm,v 1.1 2001/11/08 21:30:09 root Exp $
  2.  
  3. .386
  4.  
  5.                 extrn DosFlatToSel:near
  6.                 extrn DosSelToFlat:near
  7.  
  8.                 public __Far16Pascal
  9.  
  10. cseg01          segment byte use32 public 'CODE'
  11.                 assume cs:cseg01
  12.                 assume es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing
  13.  
  14. __Far16Pascal   proc near
  15.  
  16. var_14          = dword ptr -14h
  17.  
  18.                 push    ebp
  19.                 push    edi
  20.                 push    ebx
  21.                 push    edx
  22.                 push    es
  23.                 push    ds
  24.                 mov     ebp, esp
  25.                 push    ss
  26.                 push    ebp
  27.                 call    DosFlatToSel
  28.                 push    eax
  29.                 add     ecx, 3
  30.                 and     cl, 0FCh
  31.                 xor     ebp, ebp
  32.                 mov     bp, cx
  33.                 sub     esp, ecx
  34.                 mov     edi, esp
  35.                 shr     ecx, 1
  36.                 repe movsw
  37.                 mov     eax, esp
  38.                 call    DosFlatToSel
  39.                 push    eax
  40.                 add     bp, ax
  41.                 mov     eax, ebx
  42.                 call    DosFlatToSel
  43.                 lss     sp, [esp+14h+var_14]
  44.                 jmp      far ptr loc_20056
  45. __Far16Pascal   endp
  46.  
  47.  
  48. loc_1011F:
  49.                 lss     esp, [ebp+4]
  50.                 pop     ds
  51.                 pop     es
  52.                 pop     edx
  53.                 pop     ebx
  54.                 pop     edi
  55.                 pop     ebp
  56.                 retn    
  57.  
  58. cseg01          ends
  59.  
  60.  
  61. cseg03          segment byte use16 public 'CODE'
  62.                 assume cs:cseg03
  63.                 assume ds:nothing, es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing
  64.  
  65. loc_20056:
  66.                 mov     cx, ss
  67.                 mov     ds, cx
  68.                 mov     es, cx
  69.                 push    ax
  70.                 call    dword ptr [bp+0]
  71.                 jmp     far ptr FLAT:loc_1011F
  72.  
  73. cseg03        ends
  74.  
  75.         end
  76.