Documents
Resources
Learning Center
Upload
Plans & pricing Sign in
Sign Out

microprocessor lab programs substring

VIEWS: 116 PAGES: 1

microprocessor lab programs for engineering students

More Info
									10. a) Find out whether a given sub-string is present or not in a main string of characters.

data segment str db 'FIN substring finds$' len dw len-str sstr db 'find' msg1 db 'Sub is present$' msg2 db 'Sub is not present$' data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax mov cx,len lea si,str loop1: lea di,str loop3: mov al,[si] inc si dec cx cmp al,[di] jne loop2 inc di cmp di,offset msg1 je mes1 jmp loop3 loop2: stop: cmp cx,00h jne loop1 cmp di,offset msg1 je mes1 lea dx,msg2 jmp next lea dx,msg1 mov ah,09h int 21h mov ah,4ch int 21h code ends end start

mes1: next:


								
To top