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

  1.     .386
  2.     .model small
  3.     public _strcspn
  4.     .code
  5. _strcspn:
  6.     push    ebp
  7.     mov    ebp,esp
  8.     push    esi
  9.     push    edi
  10.     mov    esi,[8+ebp]
  11.     mov    edx,[12+ebp]
  12.     sub    eax,eax
  13. lp:
  14.     inc    eax
  15.     test    byte ptr [esi],0ffh
  16.     je    short exit
  17.     mov    edi,edx
  18.     mov    cl,[esi]
  19.     inc    esi
  20. lp1:
  21.     test    byte ptr [edi],0ffh
  22.     je    short lp
  23.     cmp    cl,[edi]
  24.     je    short exit
  25.     inc    edi
  26.     jmp    short lp1
  27. exit:
  28.     dec    eax
  29.     pop     edi
  30.     pop    esi
  31.     pop    ebp
  32.     ret
  33.     end