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

Architecture of file transfer, Explain the architecture of the file transfe...

Explain the architecture of the file transfer protocol ftp in terms of clients, servers, sockets

8088 associated with 8259 a-microprocessor, For an 8088 the 2 addresses lin...

For an 8088 the 2 addresses linked with an 8259A are normally consecutive, and the AO line is associated to the AO pin, but because there are just 8 data pins on the 8259A and the

Whle loop, program to accept 23 students name using while loop let your var...

program to accept 23 students name using while loop let your variable control the value negative 4

Assembly language, Assembly Language: Inside the 8085, instructions ar...

Assembly Language: Inside the 8085, instructions are really stored like binary numbers, not a very good manner to look at them and very difficult to decipher. An assembler is

Das-arithmetic instruction-microprocessor, DAS: Decimal Adjust after Subtr...

DAS: Decimal Adjust after Subtraction:- This instruction converts the result of subtraction operation of 2 packed BCD numbers to a valid BCD number. The subtraction operation has

Pc bus and interrupt system-microprocessor, PC Bus and Interrupt System ...

PC Bus and Interrupt System The PC Bus utilized a bus controller, address latches, and data transceivers (bidirectional data buffers). 1) Bus controller : ( Intel 8288 Bus

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

How to design 4 bit signed 2s complement multiplier?

Program to perform one byte bcd addition-assembly program, Program : Write...

Program : Write a program to perform a one byte BCD addition. Solution : It is consider that the operands are in BCD form, but the CPU considers it as hexadecimal and acco

Program, Write an application that does the following: (1) fill an array wi...

Write an application that does the following: (1) fill an array with 50 random integers; (2) loop through the array, displaying each value, and count the number of negative values;

Introduction to evaluation, This unit introduces the topic of evaluating in...

This unit introduces the topic of evaluating interactive products. It is a short unit as evaluation is discussed in more detail in Block 4. Its brevity should give you additional t

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