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
Pin functions for the minimum mode operation of 8086 are following: 1) M/I/O -Memory/IO: This is a status line logically equivalent to S2 in maximum mode. When it is low, it

The Pentium   The next member of the Intel family of microprocessors was the Pentium, introduced in the year 1993. With the Pentium, Intel broke its custom of numeric model name

;StrNCpyAsm - copy zero terminated string2 to zero terminated string1, ; but copy no more than count (parameter) characters ; or the length of string2, whi


Using DEBUG DEBUG.COM is a DOS efficacy that facilitates the trouble-shooting and debugging of assembly language programs. In particular case of personal computers, all of th

General Bus Operation The 8086 has a joined data and address bus commonly referred to as a time multiplexed address and data bus. The major reason behind  multiplexing address

write a program using assembly language that print your name

write a Mips program that read a string AND PRINT IT ON THE SCREEN

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

You have been hired by the Elbonian government to write an Assembly program to help its workforce determine how much their tax will be. The tax laws in Elbonian are very simple. Th