Class_Notes_Set_5

Class_Notes_Set_5 - String Instructions String...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: String Instructions ¡ String instructions were designed to operate on large data structures. ¡ The SI and DI registers are used as pointers to the data structures being accessed or manipulated. ¡ The operation of the dedicated registers stated above are used to simplify code and minimize its size. String Instructions ¡ The registers(DI,SI) are automatically incremented or decremented depending on the value of the direction flag: ¢ DF=0, increment SI, DI. ¢ DF=1, decrement SI, DI. ¡ To set or clear the direction flag one should use the following instructions: ¢ CLD to clear the DF. ¢ STD to set the DF. String Instructions ¡ The REP/REPZ/REPNZ prefixes are used to repeat the operation it precedes. ¡ String instructions we will discuss: ¢ LODS ¢ STOS ¢ MOVS ¢ CMPS ¢ SCAS LODS/LODSB/LODSW/LODSD ¡ Loads the AL, AX or EAX registers with the content of the memory byte, word or double word pointed to by SI relative to DS. After the transfer is made, the SI register is automatically updated as follows: ¢ SI is incremented if DF=0. ¢ SI is decremented if DF=1. LODS/LODSB/LODSW/LODSD ¡ Examples: ¢ LODSB AL=DS:[SI]; SI=SI ± 1 ¢ LODSW AX=DS:[SI]; SI=SI ± 2 ¢ LODSD EAX=DS:[SI]; SI=SI ± 4 ¢ LODS MEAN AL=DS:[SI]; SI=SI ± 1 (if MEAN is a byte)...
View Full Document

This note was uploaded on 02/16/2011 for the course EE 3751 taught by Professor Desouza during the Spring '04 term at LSU.

Page1 / 17

Class_Notes_Set_5 - String Instructions String...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online