Cmps-string manipulation instruction-microprocessor, Assembly Language

CMPS : Compare String Byte or String Word:-The CMPS instruction may be utilized to compare two strings of Words or byte. The length of the string ought to be stored in the CX. If both the word or byte strings are equal, zero flag is set. Flags are affected in the similar way as CMP instruction. The DS: SI and ES: DI point to the 2 strings. The REP instruction prefix is utilized to repeat the operation till register CX (counter) becomes zero or the condition specified by the REP prefix is false.

Following string of instructions describe the instruction. Comparison of the string begin from initial byte / word  of the string, after each comparison the index registers  are updated depending on the direction flag and the counter is decremented. This byte by byte / word by word comparison continues until a mismatch is found. When, a mismatch is found, the carry flag and zero flags are modified properly and the execution proceeds further.

Example :

2388_cmps.jpg

If both strings are fully equal, for example the register CX becomes zero, the ZF is set, or else, ZF is reset.

 

Posted Date: 10/12/2012 3:32:11 AM | Location : United States







Related Discussions:- Cmps-string manipulation instruction-microprocessor, Assignment Help, Ask Question on Cmps-string manipulation instruction-microprocessor, Get Answer, Expert's Help, Cmps-string manipulation instruction-microprocessor Discussions

Write discussion on Cmps-string manipulation instruction-microprocessor
Your posts are moderated
Related Questions
XOR: Logical Exclusive OR: The XOR operation is again carried out in a similar way to the AND and OR operation. The constraint over operands are also similar. The XOR operation pr

can any one help me in my project by using assembly language

AAS: ASCII Adjust AL After Subtraction AAS instruction correct the result in the AL register after subtracting operation of two unpacked ASCII operands. The result is in unpacked

Write a program to evaluate the following expression. You are to evaluate the following equation: num1 - (input + num2) - (num3 + num4) Input will be a hex number input by

Interrupt System Based on Multiple 8259As A multiple 8259A interrupt system is diagrammed in given figure in this figure data bus drivers are not indicated, but they could be i

given a sentence, find the number of times a particular character or word appear. the sentence is to be entered by the user

* * * * **** * * * * * How can i print this help me pls

Write a 32-bit program which when run, allows the user to select from a menu: (1)    Enter a Binary Number (2)    Enter a Decimal Number (3)    Enter a Hexadecimal Number

OR: Logical OR: The OR instruction carries out the OR operation in the similar way as described in case of the AND operation. The restriction on source and destination operands ar

IRET : Return from ISR:- When an interrupt service routine is called, before transferring control to it, the IP, CS  register and flag registers are stored in the stack to ment