home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / DOS / Programa / CCDL122.ZIP / CLIBS / STRING / 386 / STRCHR.ASM < prev    next >
Encoding:
Assembly Source File  |  1996-07-21  |  333 b   |  28 lines

  1.     .386
  2.     .model small
  3.     public _strchr
  4.     .code
  5. _strchr:
  6.     push    ebp
  7.     mov    ebp,esp
  8.     push    edi
  9.     mov    edi,[8+ebp]
  10.     sub    al,al
  11.     cld
  12.     mov    ecx,-1
  13.     repne    scasb
  14.     neg    ecx
  15.     dec    ecx
  16.     mov    edi,[8+ebp]
  17.     mov    eax,[12+ebp]
  18.     repne    scasb
  19.     je    short okexit
  20.     sub    edi,edi
  21.     inc     edi
  22. okexit:
  23.     mov    eax,edi
  24.     dec    eax
  25.     pop    edi
  26.     pop    ebp
  27.     ret
  28.     end