home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / SOFTWARE / LIBS / PMC101.ZIP / LIBSRC.ZIP / STRREV.ASM (.txt) < prev    next >
Assembly Source File  |  1994-06-14  |  616b  |  43 lines

  1. .386p
  2. locals
  3.  
  4. public  STRREV
  5.  
  6. _TEXT           segment byte public use32 'CODE'
  7. assume  cs:_TEXT
  8.  
  9. STRREV:
  10.         push edi
  11.         cld
  12.  
  13.         mov edi,[esp+4+4+00h]
  14.         mov edx,edi
  15.         or ecx,-1
  16.         xor al,al
  17.         repne scasb
  18.         not ecx
  19.         dec ecx
  20.         sub edi,2
  21.  
  22.         mov eax,edx
  23.         shr ecx,1
  24.         jz short @@00
  25.  
  26.         push eax
  27. @@00l:
  28.         mov al,[edx]
  29.         xchg al,[edi]
  30.         mov [edx],al
  31.         inc edx
  32.         dec edi
  33.         loop @@00l
  34.         pop eax
  35.  
  36. @@00:
  37.         pop edi
  38.         ret 04h
  39.  
  40. _TEXT           ends
  41. end
  42.  
  43.