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

Project, I need some guidance on which project to make in assembly language...

I need some guidance on which project to make in assembly language

Nible, calculate the number of one bits in bx and complement an equal numbe...

calculate the number of one bits in bx and complement an equal number of least significant bits in ax hint use the xor instruction

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

Test-logical instruction-microprocessor, TEST : Logical Compare Instructio...

TEST : Logical Compare Instruction: The TEST instruction performs bit by bit logical AND operation on the 2 operands. Each bit of the result is then set to value I, if the equival

8086 assembly language program, move a byte string ,16 bytes long from the ...

move a byte string ,16 bytes long from the offset 0200H to 0300H in the segment 7000H

Using straight line method for depreciation, Request a depreciation of the...

Request a depreciation of the item, year of purchase, cost of item, number of years to be depreciated (estimated life ) and,the method of depreciation . Method of depreciation sh

Entering a program-microprocessor, Entering a Program In this section, ...

Entering a Program In this section, we will explain the procedure for entering a small program on IBM PC with DOS operating system. Assume a program of addition of 2 bytes, as

Arm assembly language code, You will need to upload your main.c and factori...

You will need to upload your main.c and factorial.s files and a .jpg photo of the output on your board using the Vista assignment upload features.  It must be submitted by the dead

Progframmw, write a programme the addition two 3*3 matrix and stored in fro...

write a programme the addition two 3*3 matrix and stored in from list

Call-unconditional branch instruction-microprocessor, CALL : Unconditional...

CALL : Unconditional Call:- This instruction is utilized to call a subroutine from a basic program. In case of assembly language programming, the term procedure is utilized int

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