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

  1. ; $Id: watthunk.asm,v 1.1 2001/11/08 21:30:09 root Exp $
  2.  
  3. .386
  4.  
  5.         public    __TNC, __TNK
  6.  
  7. cseg01          segment byte use32 public 'CODE'
  8.                 assume cs:cseg01
  9.                 assume es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing
  10.  
  11. __TNC:
  12.                 push    eax
  13.                 mov     eax, [esp+8]
  14.                 add     eax, [esp+0Ch]
  15.                 add     eax, 2000h
  16.                 call    $+5
  17.                 pop     eax
  18.  
  19. __TNK:
  20.                 push    eax
  21.                 push    ebx
  22.                 push    ecx
  23.                 push    esi
  24.                 push    edi
  25.                 lea     edi, [esp+24h]
  26.                 mov     eax, [edi-8]
  27.                 mov     ebx, [edi-0Ch]
  28.                 add     ebx, 2000h
  29.                 lea     esi, [edi+eax]
  30.                 mov     ecx, esi
  31.                 sub     cx, bx
  32.                 jnb     short loc_1005B
  33.                 xor     di, di
  34.                 mov     esi, esp
  35.                 lea     ecx, [eax+28h]
  36.                 sub     edi, ecx
  37.                 sub     esp, 4
  38.                 and     sp, 0F000h
  39.  
  40. loc_10045:
  41.                 cmp     esp, edi
  42.                 jbe     short loc_10054
  43.                 mov     [esp], eax
  44.                 sub     esp, 1000h
  45.                 jmp     short loc_10045
  46.  
  47. loc_10054:
  48.                 mov     esp, edi
  49.                 shr     ecx, 2
  50.                 repe movsd
  51.  
  52. loc_1005B:
  53.                 pop     edi
  54.                 pop     esi
  55.                 pop     ecx
  56.                 pop     ebx
  57.                 pop     eax
  58.                 retn    8
  59. cseg01          ends
  60.  
  61.                 end 
  62.