;this code assumes that ES points to the correct segment. cld mov di,offset TestMessage mov al,'o' ;the byte we wish to check mov cx,5 ;len(Test) repnz scasb ;scan through the string and stop if a match is found. ;flags will be set accordingly ret TestMessage byte "Hello"