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

  1. ; $Id: wat16ff2.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 __Far16Func2
  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. __Far16Func2    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.                 lss     sp, [esp+14h+var_14]
  41.                 jmp     far ptr loc_20000
  42. __Far16Func2    endp
  43.  
  44.  
  45. loc_10035:
  46.                 lss     esp, [ebp+4]
  47.                 rol     eax, 10h
  48.                 mov     ax, dx
  49.                 rol     eax, 10h
  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_20000:
  66.                 mov     cx, ss
  67.                 mov     ds, cx
  68.                 mov     es, cx
  69.                 call    dword ptr [bp+0]
  70.         jmp     far ptr FLAT:loc_10035
  71.  
  72. cseg03        ends
  73.  
  74.         end
  75.