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 :


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
LODS : Load String Byte or String Word:- The LODS instruction loads AL/AX register by the content of a string pointed to by DS:SI register pair. The SI is automatically modifie

AAA: ASCII Adjust after Addition operation the AAA instruction is executed after an ADD instruction that adds 2 ASCII coded operands to give a byte of outcome in the AL. The AAA i

General terms for Cache : Cache Hits : When the cache consisted the information requested, the transaction is said to be a cache hit. Cache Miss : When the cache does n

ALP to preform of two 16-bit numbers in register addressing mode

Type of Microprocessor : Microprocessors fall into 3 categories: Single Chip Microcomputers: - Contains RWM, ROM, microprocessor, I/O port, timer and clock. General pu

Develop a suitable schematic circuit diagram of your system showing the interface between the PIC16F84 and the existing mains light & switch, including 5V derivation from the 240V

1. The microwave has a clock (hh:mm:ss am/pm) and the user should be able to change the clock at any time. 2. For cooking the user should first enter the time. The user can ente

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

DW : Define Word:- The DW directive serves the same purposes as the DB directive, but now it makes the assembler  which reserves thenumber ofmemory words (16-bit) instead of by

hi, i''m new to assembly language and my teacher told us to look for an example of the odd and even numbers program using debug.exe in ms dos as a guide since we just started. plea