Movsw/movsb-string manipulation instruction-microprocessor, Assembly Language

MOVSW/MOVSB : Move String Word or String Byte: Imagine a string of bytes, stored in a set  of consecutive memory locations is to be moved to another set of  the destination locations. Starting byte of the source string is located in the memory location whose address can be computed by using DS (data segment) and SI (source index) contents. Starting address of the destination locations where this string has to be relocated is given by ES (extra segment) and Dl (destination index) contents. Starting address of the source string is 10H*DS+[SI],  whereas the starting  address of the destination  string is 10H*ES+[DI].  The MOVSB/MOVSW instruction therefore, moves a string of bytes/ words pointed to by DS: SI pair (source) to the memory location pointed to by ES: Dl pair (destination).  The REP instruction prefix is utilized with MOVS instruction to repeat it by a value given in the register counter (CX). The length of word string or byte string ought to be stored in register CX register. Flags are remaining unaffected by this instruction.

After the MOVS instruction is executed, the index registers are automatically updated and register CX is decremented. The decrementing or incrementing of the pointers, for example DI and Sl depend on the direction flag DF. If flag DF is 0, the index registers are incremented, or else, they are decremented, in all casa of the string manipulation instructions. Following string of instructions explain the execution of the MOVS instruction.

Example :

1000_movsb.jpg

Posted Date: 10/12/2012 3:27:51 AM | Location : United States







Related Discussions:- Movsw/movsb-string manipulation instruction-microprocessor, Assignment Help, Ask Question on Movsw/movsb-string manipulation instruction-microprocessor, Get Answer, Expert's Help, Movsw/movsb-string manipulation instruction-microprocessor Discussions

Write discussion on Movsw/movsb-string manipulation instruction-microprocessor
Your posts are moderated
Related Questions
IMUL: Signed Multiplication: This instruction multiplies a signed byte by a signed bit in source operand e in the register AL or signed word in source operand by signed word in th

Write an assembly program that adds the elements in the odd indices of the following array. Use LOOP. What is the final value in the register?

DEC : A powerful new Alpha 64 bit RISC computer chip was introduced in the year 1977, as new VAX (Virtual Address Extension) Computer. The VAX was 32 bit computer line based on

1- Write an assembly program that:   a- Defines an array of 10 (word type)elements;   b- Finds out the number of negative elements   c- Calculate the summation of the posi

(1) Write a program that will: (a) display "Enter Your Name:" (b) convert the entered name to Capital letters (if small), If any other character is entered, the program wil

Example : Add the contents of the 2000H: 0500H memory location to contents of 3000H: 0600H and store the result in 5000H: 0700H. Solution : Unlike the past example progra

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

Interrupt System Based on Multiple 8259As A multiple 8259A interrupt system is diagrammed in given figure in this figure data bus drivers are not indicated, but they could be i

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

) What is the difference between re-locatable program and re-locatable data?