Presentation is loading. Please wait.

Presentation is loading. Please wait.

Princess Sumaya Univ. Computer Engineering Dept. Chapter 9:

Similar presentations


Presentation on theme: "Princess Sumaya Univ. Computer Engineering Dept. Chapter 9:"— Presentation transcript:

1 Princess Sumaya Univ. Computer Engineering Dept. Chapter 9:

2 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 1 / 10 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)

3 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 2 / 10 String Operations String Transfer Operations MOVS (Byte or Word) Memory DS 0000 0001 SI 0002 0003 0004 0005Memory ES 0000 0001 0002 0003 DI 0004 0005

4 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 3 / 10 String Operations String Transfer Operations LODS (Byte or Word) Memory DS 0000 0001 SI 0002 0003 0004 0005Memory ES 0000 0001 0002 0003 DI 0004 0005 AL

5 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 4 / 10 String Operations String Transfer Operations STOS (Byte or Word) Memory DS 0000 0001 SI 0002 0003 0004 0005Memory ES 0000 0001 0002 0003 DI 0004 0005 AL

6 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 5 / 10 Repeated String Operations Repeated String Transfers REP, REPZ, REPNZ (REPE, REPNE) Example: Memory DS 0000 0001 SI 0002 0003 0004 0005Memory ES 0000 0001 0002 DI 0003 0004 0005

7 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 6 / 10 Repeated String Operations Example: Copy String Memory DS 0000 0001 SI 0002 0003 0004 0005 ES 0000 0001 DI 0002 0003 0004 0005

8 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 7 / 10 Repeated String Operations Example: Convert to Lower Case Memory DS 0000 0001 SI 0002 0003 0004 0005 ES 0000 0001 DI 0002 0003 0004 0005

9 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 8 / 10 Repeated String Operations Example: B[i] = – A[i] Memory DS 0000 0001 SI 0002 0003 0004 0005 ES 0000 0001 DI 0002 0003 0004 0005

10 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 9 / 10 String Comparison Compare Two Strings CMPS (Byte or Word) Example:Find the First Mismatch Memory DS 0000 0001 SI 0002 0003 0004 0005 ES 0000 0001 DI 0002 0003 0004 0005

11 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. 10 / 10 String Search Scan Destination String SCAS (Byte or Word) Example:Search for the Letter a Memory DS 0000 0001 SI 0002 0003 0004 0005 ES 0000 0001 DI 0002 0003 0004 0005

12 Princess Sumaya University 22342 – Computer Org. & Assembly Lang. Computer Engineering Dept. Chapter 9


Download ppt "Princess Sumaya Univ. Computer Engineering Dept. Chapter 9:"

Similar presentations


Ads by Google