microprocessor lab programs substring

Document Sample
microprocessor lab programs substring Powered By Docstoc
					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:


				
DOCUMENT INFO
Shared By:
Stats:
views:116
posted:11/7/2009
language:English
pages:1
Description: microprocessor lab programs for engineering students