home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / DOS / Programa / CCDL122.ZIP / CLIBS / STRING / 386 / STRCMP.ASM < prev    next >
Encoding:
Assembly Source File  |  1996-06-29  |  391 b   |  33 lines

  1.     .386
  2.     .model small
  3.     public _strcmp
  4.     .code
  5. _strcmp:
  6.     push    ebp
  7.     mov    ebp,esp
  8.     push    esi
  9.     push    edi
  10.     mov    edi,[8+ebp]
  11.     mov    esi,edi
  12.     mov    ecx,-1
  13.     sub    al,al
  14.     repne    scasb
  15.     neg    ecx
  16.     dec    ecx
  17.     mov    edi,[12+ebp]
  18.     repe    cmpsb
  19.     je    short zer
  20.     js    short nega
  21.     mov    eax,1
  22.     jmp    short exit
  23. zer:
  24.     sub    eax,eax
  25.     jmp    short exit
  26. nega:
  27.     mov    eax,-1
  28. exit:
  29.     pop    edi
  30.     pop    esi
  31.     pop    ebp
  32.     ret
  33.     end