Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
7Activity
0 of .
Results for:
No results containing your search query
P. 1
String Instructions

String Instructions

Ratings: (0)|Views: 40|Likes:
Published by adithya123456

More info:

Published by: adithya123456 on Nov 22, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PPT, PDF, TXT or read online from Scribd
See more
See less

03/22/2013

pdf

text

original

 
 
String Instructions
A series of data bytes or wordsavailable in memory at consecutivelocations, to be referred tocollectively or individually are calledas byte strings or word strings.For referring to a string, twoparameters are required 1. stringstarting address 2. length of string. The length of a string is usuallystored as count in the CX register8086 supports powerful instructionsfor string manipulations. Theincrementing or decrement of thepointer in string instruction, dependsupon the Direction Flag (DF) status.If it is a byte string operation, theindex registers are updated by one.If it is a word string operation, theindex register are updated by two. The counter in both the cases, isdecremented by one.
 
 
REP: Repeat Instruction Prefix:
 This instruction is used as a prefix toother instructions. The instruction towhich the REP prefix is provided, isexecuted repeatedly until CX registerbecomes zero (at each iteration CX isautomatically decremented by one).REPE/REPZ: Repeat while equal/zeroREPNE/REPNZ: Repeat while notequal/not zero These options are used for CMPS, SCASinstructions only as instructionprefixes.
MOVSB/MOVSW: Move stringByte/Word
If source string is in DS, it has to moveto ES then The string address of the source stringis 10h*DS+[SI] while the startingaddress of the destination string is10h*ES+[DI].
 
 
After MOVS instruction is executedonce, the index registers (SI,DI) areautomatically updated and CX isdecremented. The incrementing ordecrementing of the pointer, i.e. SIand DI depend upon the direction flagDF.If DF is zero, the index registers areincremented, If DF is one they aredecremented, in case of all the stringmanipulation instructions.Example:MOV AX, SEGMOV ES, AXMOV DI,OFFSET STRMOV CX,0010HMOV AX, word ;
the word to be scanned
CLD
; clear DF to auto increment of DI
REPNE SCASW ;
Repeat until not equal 

Activity (7)

You've already reviewed this. Edit your review.
1 hundred reads
Harsha Naidu liked this
subhakarb liked this
zerokoolz liked this
thirumaleshn liked this
REHMAN MALIK liked this
srihari29691 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->