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

  1.     page    66,132
  2. ;******************************* SCAN12.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_LAST_CHAR3 - scan  buffer for last char match, case match
  16. ;  inputs: es:di = asciiz string
  17. ;             al = character to search for
  18. ;             cx = buffer length
  19. ;
  20. ;  output:  registers di,cx are updated
  21. ;           if flags in "je" state then match was found at es:[di]
  22. ;
  23. ;           if flags in 'jne' state then no match was found
  24. ;                  cx=0 and es:di point at start of buffer
  25. ;           direction flag = CLD state
  26. ;* * * * * * * * * * * * * *
  27. 
  28.  
  29.     PUBLIC    SCAN_LAST_CHAR3
  30. SCAN_LAST_CHAR3    PROC    FAR
  31.     std
  32.     add    di,cx
  33.     repne    scasb
  34.     jcxz    sl3
  35.     inc    di
  36. sl3:    cld
  37.     retf    
  38. SCAN_LAST_CHAR3    ENDP
  39. ;------------------------------------------------------------------------
  40.  
  41. LIBSEG    ENDS
  42. ;;    end
  43.