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

  1. ; $Id: wat16ff.asm,v 1.1 2001/11/08 21:30:08 root Exp $
  2.  
  3. .386
  4.  
  5.                 extrn DosFlatToSel:near
  6.                 extrn DosSelToFlat:near
  7.  
  8.                 public __Far16Func
  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. __Far16Func     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.                 lss     sp, [esp+14h+var_14]
  42.                 jmp      far ptr loc_20034
  43. __Far16Func     endp
  44.  
  45.  
  46. loc_10083:
  47.                 lss     esp, [ebp+4]
  48.                 rol     eax, 10h
  49.                 mov     ax, dx
  50.                 rol     eax, 10h
  51.                 pop     ds
  52.                 pop     es
  53.                 pop     edx
  54.                 pop     ebx
  55.                 pop     edi
  56.                 pop     ebp
  57.                 retn    
  58.  
  59. cseg01          ends
  60.  
  61.  
  62. cseg03          segment byte use16 public 'CODE'
  63.                 assume cs:cseg03
  64.                 assume ds:nothing, es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing
  65.  
  66. loc_20034:
  67.                 mov     cx, ss
  68.                 mov     ds, cx
  69.                 mov     es, cx
  70.                 call    dword ptr [bp+0]
  71.                 jmp     far ptr FLAT:loc_10083
  72.  
  73. cseg03        ends
  74.  
  75.         end
  76.