answersLogoWhite

0

Registers used: ax,ds,si,di,cl

flags affected: zf,cf

program:

assume cs:code,ds:data

code segment

mov ax,data

mov ds,ax

mov si,offset str1

mov di,offset str2

mov cl,count

cld

rep cmpsb

hlt

code ends

data segment

str1 db 04h,05h,07h,08h

count equ 04h

org 0010h

str2 db 04h,06h,07h,09h

data ends

end

result:

input: str1 (ds:0000h) = 04h,05h,07h,08h

str2 (ds:0010h) = 04h,06h,07h,09h

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering
Related Questions

Write a c program to copy two strings using pointers?

nahi malum


Write a script that accepts two strings from the user and compare two strings in web technology?

how to compare two strings that take input from the user and compare it. For example: i give first string as "THE" and give second string as "HTE" then return "match" if i give first as"THE" nd second string as "EHI" then return "NOtMatch" witout using STRCMP ... please help me


Write a program to compare two strings with out using strcmp function?

#include main() { //please read two strings int str1 and str2// while(str1[i]!='/0' &&str2[i]!='/0') if(str1[i]!=str2[i]) flag=1; if(flag==1) printf("equal"); } #include main() { //please read two strings int str1 and str2// while(str1[i]!='/0' &&str2[i]!='/0') if(str1[i]!=str2[i]) flag=1; if(flag==1) printf("equal"); }


A Write the algorithm to concatenate two given strings?

a write the algorithm to concatenate two given string


'c' code to compare two strings using strcmp function?

char one [] = "A string" ;char two [] = "Different String" ;if (strcmp (one, two) == 0){puts ("The two strings are identical") ;}else{puts ("The two strings are different") ;}


What is the Program for compare two strings using OR operator in java?

The String class includes two helpful methods: equals and compareTo.string1.equals(string2) will return true if the two strings contain the exact same charactersstring1.compareTo(string2) will return an int which describes the lexicographic relationship between the two strings. It will return a negative value if string1 is "less than" string2, a positive value if string1 is "greater than" string2, or zero if the two are equivalent strings.


Write a program in c that prompt user with following lines add two integers test an integer for odd or even and quit?

write a program in C that prompts the user with the following lines: a) Add two integers c) Compare two integers for the larger t) Test an integers for odd or even q) Quit


What is the C plus plus program for string compare?

You don't need a program to compare strings since std::string already provides support for all the comparison operators (<, <=, >, >=, == and !=). To roll your own you must first create a string class and then provide operator overloads for the comparison operators. To compare strings, start at the first character in each string and compare. So long as they remain equal, move onto the next character. The comparison ends as soon as any character differs. You need only compare these two characters to decide which string is the lesser. To perform a case insensitive comparison, copy the two characters and convert the copies to lower case (or upper case, it doesn't matter). Then compare the copies. Do this for each character as you compare them rather than converting the entire string.


How to write aC program to merge two singly linked list?

write a c program to circular queue


For curiously write the form you would use to compare two things?

what is the form you would use the word curiously to compare two things


Write a regular expression for binary strings with at least two 0s but not consecutive 0s.?

1*01+01*


Write a program to add two 8 bit numbers in microprocessor 8051?

write it in 8085