~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to strings/strings.asm

MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
477
477
_strstr ENDP
478
478
 
479
479
        ;
480
 
        ; Find a substring in string, return index
481
 
        ; Arg: str,search
482
 
        ;
483
 
 
484
 
        PUBLIC  _strinstr
485
 
_strinstr       PROC
486
 
        push    bp
487
 
        mov     bp,sp
488
 
        push    di
489
 
        les     di,DWORD PTR [bp+10]    ; search
490
 
        push    es
491
 
        push    di
492
 
        les     di,DWORD PTR [bp+6]     ; str
493
 
        push    es
494
 
        push    di
495
 
        call    _strstr
496
 
        mov     cx,ax
497
 
        or      cx,dx
498
 
        jz      si_99
499
 
        sub     ax,di                   ; Pos from start
500
 
        inc     ax                      ; And first pos = 1
501
 
si_99:  add     sp,8
502
 
        pop     di
503
 
        pop     bp
504
 
        ret
505
 
_strinstr       ENDP
506
 
 
507
 
        ;
508
480
        ; Make a string of len length from another string
509
481
        ; Arg: dst,src,length
510
482
        ; ret: end of dst
912
884
        endcode strstr
913
885
 
914
886
        ;
915
 
        ; Find a substring in string, return index
916
 
        ; Arg: str,search
917
 
        ;
918
 
 
919
 
        begcode strinstr
920
 
        public  _strinstr
921
 
_strinstr proc near
922
 
        push    ebp
923
 
        mov     ebp,esp
924
 
        push    P+SIZEPTR[ebp]          ; search
925
 
        push    P[ebp]                  ; str
926
 
        call    _strstr
927
 
        add     esp,SIZEPTR*2
928
 
        or      eax,eax
929
 
        jz      si_99                   ; Not found, return NULL
930
 
        sub     eax,P[ebp]              ; Pos from start
931
 
        inc     eax                     ; And first pos = 1
932
 
si_99:  pop     ebp
933
 
        ret
934
 
_strinstr       endp
935
 
        endcode strinstr
936
 
 
937
 
        ;
938
887
        ; Make a string of len length from another string
939
888
        ; Arg: dst,src,length
940
889
        ; ret: end of dst