Briefly explain CMPSW
Briefly explain CMPSW
Solution:
CMPSW:(compare string of type word)
CMPSW(Compare string word)/CMPSB(compare string of type Byte)/CMPS(compare string ) Instruction :
String Instruction in 8086 assembly language contains series of data item which are of same type . The data is present in sequential memory locations. CMPS instruction is used in order to compare a byte present in one string with a byte present in another string or it can also be used to compare a word present in one string with a word present in another string. SI(source) holds the offset of a word or byte in the source string and DI (destination)is used to hold the offset of a word or byte in the other string. The comparison is carried by subtracting a word or byte that is pointed by DI from the word or byte pointed by SI. The Error Flags such as CF,AF,OF,ZF,SF,PF are affected by the comparison but ,the operand is not affected.
Step by step
Solved in 2 steps