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
Need help with 2 homework assignments

code to add two matrices

Program Translation Sequence Developing a software program to accomplish a particular task, the implementer chooses an appropriate language, develops the algorithm (a sequence

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

use">http://www.raritanval.edu/uploadedFiles/faculty/cs/full-time/Brower/CISY256/2013Spring/CISY256%20Assembly%20Project.pdf use microsoft visual 2010 and http://www.asmirvine.c

AAM: ASCII Adjust for Multiplication after execution. This instruction converts the product available in the AL into unpacked BCD format.  This follows a multiplication   instruct

Interrupt Table Each interrupt level has a booked memory location, called an interrupt vector.  All these vectors (or pointers) are stored in the interrupt table. Table lies at

Code for Reading Flow & Generating LED Output The code starts with the scanning of the PORT 3, for reading the flow status to check for various flow conditions and compare to


AAA: ASCII Adjust after Addition operation the AAA instruction is executed after an ADD instruction that adds 2 ASCII coded operands to give a byte of outcome in the AL. The AAA i