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
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

Logical Instruction : This type of instructions is utilized for carrying out the bit by bit shift, basic logical operations or rotate. All of the condition code flags are affe


CBW: Convert Signed Byte to Word: This instruction converts a signed byte to a signed word. In other terms, it copies the sign bit of a byte to be converted to all of the bits in

Explain the basic method for implementing paging


Write a program to merge two sorted arrays to create a third sorted array containing all values from the two original arrays. Merge is a key component to the mergesort algorithm.

SUB: Subtract :- The subtract instruction subtracts the source operand from destination operand and result is left in the destination operand. Source operand might be memory locati

Assembly Code for Reading Flow & Generating Serial Output The timer is timer 1 is set for the baud rate 9600, as the crystal used is of 11.0592 Hz.  Then the timer 1 is starte

program to find negative and positive integers from given signed numbers with output and explanation of every instructions.