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 :


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
Write Policy A write policy determines how the cache deals with a write cycle. The 2 common write policies areWrite-Throughand Write-Back. In Write-Back policy, the cache behav

There are two parts to this assignment. The first part has you reading 4 integers representing; #QUARTERS, #DIMES, #NICKELS & #PENNIES, respectively. Your program should compute t

Read Architecture : Look Aside Cache In "look aside" cache architecture the main memory is located conflictingthe system interface. Both the cache main memory sees a bus cycle

Write a 68hc11 assembly language program which generation of the following waveforms connected to your DAC i)   Square wave ii)  Saw tooth waveform iii) Sine wave iv) U

MLIL: Unsigned Multiplication Byte or Word: This instruction multiplies an unsigned byte or word by the contents of the AL. The unsigned byte or word can be in any one of the gene

$NOMOD51 $NOSYMBOLS ;***************************************************************************** ; Spring 2013 Project ; ; FILE NAME : Project.ASM ; DATE : 3/30/20

DEC:  Decrement :- The decrement instruction subtracts 1 from the contents of the particular memory location or register. All the conditions code flags except carry flag are affec

I was wondering if you guys could offer me some advice and help on how to proceed - not answers- for a homework problem I am attempting. I am currently working on a "bomb" project

SHORT  : The  SHORT operator denoted to the assembler that only one byte is needed to code the displacement for a jump (for example displacement is within -128 to +127 bytes fr