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

  1. ; $Id: wat16fp2.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 __Far16Pascal2
  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. __Far16Pascal2  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.                 push    eax
  28.                 add     ecx, 3
  29.                 and     cl, 0FCh
  30.                 xor     ebp, ebp
  31.                 mov     bp, cx
  32.                 sub     esp, ecx
  33.                 mov     edi, esp
  34.                 shr     ecx, 1
  35.                 repe movsw
  36.                 mov     eax, esp
  37.                 call    DosFlatToSel
  38.                 push    eax
  39.                 add     bp, ax
  40.                 mov     eax, ebx
  41.                 call    DosFlatToSel
  42.                 lss     sp, [esp+14h+var_14]
  43.                 jmp      far ptr loc_20022
  44. __Far16Pascal2  endp
  45.  
  46.  
  47. loc_100D3:
  48.                 lss     esp, [ebp+4]
  49.                 pop     ds
  50.                 pop     es
  51.                 pop     edx
  52.                 pop     ebx
  53.                 pop     edi
  54.                 pop     ebp
  55.                 retn    
  56.  
  57. cseg01          ends
  58.  
  59.  
  60. cseg03          segment byte use16 public 'CODE'
  61.                 assume cs:cseg03
  62.                 assume ds:nothing, es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing
  63.  
  64. loc_20022:
  65.                 mov     cx, ss
  66.                 mov     ds, cx
  67.                 mov     es, cx
  68.                 push    ax
  69.                 call    dword ptr [bp+0]
  70.                 jmp     far ptr FLAT:loc_100D3
  71.  
  72. cseg03        ends
  73.  
  74.         end
  75.