home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / SCAN06.ASM < prev    next >
Assembly Source File  |  1994-10-31  |  1KB  |  43 lines

  1.     page    66,132
  2. ;******************************* SCAN06.ASM *********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11.     extrn    strlen2:far
  12. .list
  13. comment 
  14. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -( SEARCH  )
  15. ;SCAN_CHAR1 - scan asciiz buffer for character, case match
  16. ;  inputs:    al = character
  17. ;          es:di = string buffer, terminated with zero char.
  18. ;           
  19. ;  output: if flag set to "je" then match found
  20. ;                  es:di = pointer one char past match point
  21. ;                     cx = amount of data remaining to be searched
  22. ;          if flag set to "jne" then no match found
  23. ;                  es:di = pointer past end of buffer
  24. ;                     cx = zero
  25. ;* * * * * * * * * * * * * *
  26. 
  27.  
  28.     PUBLIC    SCAN_CHAR1
  29. SCAN_CHAR1    PROC    FAR
  30.     apush    ds,ax
  31.     mov    ax,es
  32.     mov    ds,ax
  33.     call    strlen2        ;returns cx=length 
  34.     pop    ax
  35.     repne    scasb
  36.     pop    ds
  37.     retf    
  38. SCAN_CHAR1    ENDP
  39. ;------------------------------------------------------------------------
  40.  
  41. LIBSEG    ENDS
  42. ;;    end
  43.