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
init_lcd                        ;(this initialises a 2 row lcd)     bcf     TRISA,0             ;PORTA bit 0 as an output (lcd RS pin)     bcf     TRISA,1             ;PORTA bit 1

using 8086 assembly language that interchange upper four bits to lower four bits. assume that data store in byte memory and it written back to same location. and assume the data as

Interrupt Priority Management The interrupt priority management logic indicated in given figure can be implemented in several ways. It does not required to be present in system

take an integer and its base and the base in which you want to convert the number from user and perform conversion.

Write a program on the assembly language to do the following: 1- Allocate array with 32bit 100 element 2- Prompt the user to enter the maximum or the upper bound of the rando

Machine Coding the Programs So far we have describe five programs which were  written  for hand coding  by a programmer. In this, we will now have a deep look at how these prog

1 st Generation Microprocessor : At the end of the 70s a group of engineers developed a chip is able to processing data. This chip was called processor chip. Big processors w

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.

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

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