120 likes | 263 Views
Chapter 9:. 22342 – Computer Organization & Assembly Language. Strings & Arrays. String Operands. String Operands Defaults Byte, Word or Double Element Size DS:SI Points to Source String ES:DI Points to Destination String Register Use is Limited to AL & AX
E N D
Chapter 9: 22342 – Computer Organization & Assembly Language Strings & Arrays
String Operands • String Operands Defaults • Byte, Word or Double Element Size • DS:SI Points to Source String • ES:DI Points to Destination String • Register Use is Limited to AL & AX • Auto Increment or Decrement of the Index (Pointer)
String Operations • String Transfer Operations • MOVS (Byte or Word)
String Operations • String Transfer Operations • LODS (Byte or Word)
String Operations • String Transfer Operations • STOS (Byte or Word)
Repeated String Operations • Repeated String Transfers • REP, REPZ, REPNZ (REPE, REPNE) Example:
Repeated String Operations Example: Copy String
Repeated String Operations Example: Convert to Lower Case
Repeated String Operations Example: B[i] = – A[i]
String Comparison • Compare Two Strings • CMPS (Byte or Word) Example:Find the First Mismatch
String Search • Scan Destination String • SCAS (Byte or Word) Example:Search for the Letter ‘a’