Cmps-string manipulation instruction-microprocessor, Assembly Language

Assignment Help:

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.

 


Related Discussions:- Cmps-string manipulation instruction-microprocessor

Program to move string from offset-assembly program, Program : A program t...

Program : A program to move a string of the data words from offset 2000H to offset 3000H the length of the string is OFH. Solution : For writing this program, we will use

4 bit 2s complement multiplier, How to design 4 bit signed 2s complement m...

How to design 4 bit signed 2s complement multiplier?

Programming with an assembler-microprocessor, Programming with an assembler...

Programming with an assembler The procedure of hand-coding 8086 programs is somewhat tiresome; hence generally a programmer may find it hard to get a correct listing of the mac

Assembler directives and operators-microprocessor, Assembler Directives and...

Assembler Directives and Operators The major advantage of machine language programming is directly that the memory control is in the hands of the programmer, so that, he can be

Port mapped or mapped input output, Port Mapped I/O or I/O Mapped I/O I...

Port Mapped I/O or I/O Mapped I/O I/O devices are mapped into a separate address space. This is generally accomplished by having a different set of signal lines to denote a mem

Sequence of interrupts, As an instance of the normal priority mode, imagine...

As an instance of the normal priority mode, imagine that initially AEOI is equal to 0 and all the ISR and IMR bits are clear. Also consider that, as shown in given figure, requests

Dma controller-microprocessor, DMA controller :     Steps in...

DMA controller :     Steps include in transferring a block of data from I/O devices (for example a disk) to memory: 1. CPU sends a signal to initiate disk transfe

Linking a program-microprocessor, Linking a program The DOS linking pro...

Linking a program The DOS linking program LINK.EXE links the different object modules of function library routines and source program to produce an integrated executable code o

8237 modes-microprocessor, 8237 modes : Intel 8237 can be set to four d...

8237 modes : Intel 8237 can be set to four different type of style of transfer: 1) Single - One transfer at a time,  it allow processor access to the bus between transfers

String manipulation instruction-microprocessor, String Manipulation Instruc...

String Manipulation Instruction A series of words or data bytes are available in memory at consecutive locations, to be mention to individually or collectively, are known as by

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd