umbc

UMBC L A N R Y D A B M A L F T U M B C I 1 O M - PowerPoint PPT Presentation


  1. ✴ ✑ ✛✜ ✑ ✰✱ ✢ ✟ ✌ ✖✤ ✄ ✤ ✑ ✙ ✜ ✲ ✩✪ ☞ ✝ ✫ ✲ ✯ ✳ ✞✚ ✘ ✏✑ ✒ ☛ ✟☞ ✝ ✝ ✆ ☛ ✗ ✏✓ ✄ ✔ ✄ ☎ ✄ ✆ ✝ ✕✖ ✁ ✝ �✂✁ ✌✎✍ ✞✠✟✡ ✬✎✭ ✰✎✵ ✮✠✯ String�Operations. MOVS ,� LODS ,� STOS ,� INS ,� OUTS Allow�data�transfers�of�a�byte,�a�word�or�a�double�word,�or�if�repeated,�a� block�of�each�of�these. The� D �flag-bit�(direction),� SI �and� DI �are�implicitly�used. •� D�=�0 :�Autoincrement� DI �and� SI .� Use� CLD �instruction�to�clear�this�flag. •� D�=�1 :�Autodecrement� DI �and� SI .� Use� STD �instruction�to�set�it. DI : Accesses�data�in�the�extra�segment.�Can�NOT�override. SI : Accesses�data�in�the�data�segment.�Can�be�overridden�with�segment� override�prefix. UMBC L A N R Y D A B M A L F T U M B C I 1 O M O Y T R ✔✎✣ ✑✦✥ ✧✎★ I E S R C E O V U I N N U T Y 1 6 9 6

  2. ✟ ✞ ✁✂ � ✁✂ ✁ ✄ ☎ ✆ ✁✝ �✟ ✄ ✠ ✡ ✟ ☛☞ ☎ ✟ ☛ ✞ ✁ ☎ ☛ ✲ ✠ ✆✟ ☎ ✄ ✁ ✁✂ � ✰✱ ✲ ✙✚ ✯ ✳ ✴ ✜ �✟ ✙ ✛ ✒ ✚ ✄ ✌ � �✟ ✌ ✆✟ ✄ ✑ ☎ ✆ ✁✝ ✞ ✠ ✟ ✡ ✟ ☛☞ ☎ ✟ ☛ ✞ ✟ ☛ ✞ � ✠ ✑ ✒ ✓ � ✁✂ ✁ ✄ ✔ ☎ ☛ ✁✕ ✞ �✟ ✠ ✡ ✟ ☛☞ ☎ ✟ ✡ ☛☞ ✌ ✌ ✙ ✞✚ ✛✜ ✑ ☛ ✢ � ✟ ✖✤ ✗ ✞ ✤ ✑ ✑ ✜ ☛ ✩✪ ☞ ✘ ✁ ✫ ✝ ☎ ✆ ✝ ✄ ✑ ☛ ✟☞ ✝ ✌ ✕✖ ☛ ✏✑ ✒ ✏✓ ✔ ✄ ✄ ✆ ✝ ✝ � ✞ ✒ ✆✟ ☎ ✔ ✄ ✁ ✁✂ � ✓ ✢ ✡ ✌ ☛ ✟ ✞ ☛ ✟ ☎ ✁✝ ✠ � ☎ ☎ ✁✝ ✆ ✞ ☛☞ � ✡ ✠ ✆✟ ✄ ☛☞ ✌ ☛ � ✞ ☛ � ☎ ✁✕ ✞ ☛ �✂✁ ✌✎✍ ✞✠✟✡ ✬✎✭ ✰✎✵ ✮✠✯ String�Operations. LODS :� Loads� AL ,� AX �or� EAX �with�data�stored�at�the�data�segment�(or�extra� segment)�+�offset�given�by� SI . SI �is�incremented�or�decremented�afterwards: LODSB ✍✏✎ LODSD ✍✏✎ LODS ✍✏✎ doubleword. LODS ✖✘✗ STOSB :� Stores� AL ,� AX �or� EAX �to�the�extra�segment�(ES)�+�offset�given�by� DI .� ES�cannot�be�overridden. DI �is�incremented�or�decremented�afterwards: STOSB ✍✏✎ STOSD ✍✏✎ STOS ✍✏✎ word. UMBC L A N R Y D A B M A L F T U M B C I 2 O M O Y T R ✔✎✣ ✑✦✥ ✧✎★ I E S R C E O V U I N N U T Y 1 6 9 6

  3. ✟ ✠ ✑ ✑ ✜ ✩✪ ☞ ✝ ✫ ✲ ✲ ✡ ✠ ✞ ✟ ✡ ✞ ✁ ✞ ✁ ✄ ☎ ✆ � ✝ ✞ ✰✱ ✞ ✄ ✝ ✞ ✞ ✞ ✤ ✂ ✖✤ ✝ ✏✓ ✒ ✏✑ ☛ ✳ ✝ ✟☞ ✌ ☛ ✴ ✄ ✝ ✆ ☎ ✔ ✄ ✄ ✆ ✟ ✢ ✯ ✑ ✛✜ ✞✚ ✙ ✘ ✗ ✁ ✕✖ ✝ ✧✎★ 11000 ✑✦✥ ✔✎✣ 2 + +/- LODSW *10H 3 String�Operations: UMBC DS CS ES SS ✌✎✍ ✰✎✵ ✞✠✟✡ EAX EBX ECX EDX ESP EBP EDI ESI R E C O U O N M T I Y T L A B U M B C D 6 N 6 A 9 L 1 Y ✮✠✯ R A M F O U Y N T V I I S R E �✂✁ ✬✎✭

  4. ✜ ✄ ✒ ✛ ✙ ✍ ✎ ✙ ✏ ✆ ✝ ☎ ☎ ✜ ✄ ☎ ✎ ☎ ✖ ✓ ✓ ✎ ✙ ✡ ☎ ✜ ✄ ✢ ✑ ✗ ✙ ✎ ✝ ✚ ✆ ✄ ☎ ☎ ✞ ☎ ✟ ✙ ✟ ✙ ✠ ✡ ✠ ✙ ✌ ✚ ✙ ☛ ✡ ✌ ✍ ✛ ✙ ✜ ☎ ✁ ✛ ✛ ✒ ☎ ✄ ✢ ✛ ✠ ✖ ✔ ✚ ✜ ✗✘ ✙ ✄ ✚ ✛ ✄ ✜ ☎ ✟ ✔ ✙ ✔ ✚ ✡ ✖ ✙ ✎ ✠ ✚ ✙ ✙ ☛ ☛ ✙ ☎ ✢ ✕ ✍ ✔ ✛ ✠ ✍✓ ☛ ✡ ✜ ✄ ☎ ✔ ☎ ✡ ✞ ☎ ✕ ✍ ✔ ✛ ✔ ✡ ✡ ✚ ✒ ✕ ✓ ☎ ✝ ✕✖ ✄ ✆ ✖✤ ✤ ✑ ✑ ✜ ✩✪ ☞ ✝ ✫ ✆ ✄ ✢ ✔ ✏✓ ✒ ✝ ✏✑ ☛ ✝ ✝ ✟☞ ☛ ✄ ✝ ✟ ✌ ✁ � ✗ ✖ � ✜ ✘ ✆ ✕ ✂ ✑ ☛ ✁ ✙ ✂ ✞✚ ✴ ✳ ✯ ✲ ✲ ✰✱ ✛✜ ☎ ✧✎★ NOTE:� REP �does�not�make�sense�with�the� LODS �instruction. ✑✦✥ ✔✎✣ ✒ ☞☛ Executes�the�instruction� CX �times. 4 AX String�Operations. UMBC MOV DI MOV CX MOV AX .STARTUP MOV AX MOV ES REP �prefix: ✌✎✍ .CODE CLD .EXIT END ✰✎✵ ✞✠✟✡ R E C O U O N M T I Y T L A B U M B C D 6 N 6 A 9 L 1 Y ✮✠✯ R A M F O U Y N T V I I S R E �✂✁ ✬✎✭

  5. ✄ ✑ ☛ ✟ ✞ ☛ ✟ ☎ ✌ ✑ ☛ � ✞ ☛ � ☎ ☛☞ ✌ � ✡ ✟ ✡ ✞ ☛☞ � ✡ ✠ ✆ ✁ ☎ ✢ ✂ ✄ ✄ ✂ ✄ ✜ ✟ ✠ ✝ ✟ � ✞ ☛ � ☎ ☛☞ ✡ ✌ ✠ �✟ ✞ ✄ � ✡ ✠ ☛ ✄ �✟ ✆ ✞ ☛☞ � ✡ ✠ ✟ ☎ ☎ ✄ ✌ ☛ ✟ ✞ ☛ ✟ � ☞ ☎ ☎ ✌ ☛ � ✞ ☛ � ☞ ☎ ✝ � ✡ ✞ ☛☞ � ✡ ✑ ✡ ✟ ☎ ✌ ☛ ✟ ✞ ☛ ✟ ☛☞ � ✟ ✡ ✠ �✟ ✞ ☞ ✝ ✠ ✆ ☎ ✟ ✢ ✌ ☛ ✟ ✞ ☛ ☎ ✆✟ ✢ ✌ ☛ � ✞ ☛ � ☎ ✠ ☎ � ✄ ✌ ☛ � ✞ ☛ ☎ ✡ ☞ ✝ � ✡ ✞ ☛☞ � ✆✟ ☛☞ ✝ ✑ ✲ ✯ ✳ ☛ ✴ ✤ ✄ ✰✱ ✑ ✜ ✩✪ ✫ ✝ ✝ ✟☞ ✲ ✖✤ ✆ ✕✖ ✑ ✛✜ ✞✚ ✙ ✘ ✗ ✁ ✝ ✌ ✆ ✄ ✄ ✔ ✏✓ ✒ ✏✑ ☛ ✄ ✟ ✄ ☛ ✞ � ☛ ✌ ✆ ☎ ☎ ✟ ☛ ✞ ✟ ☛ ✌ ☎ � ☛☞ ✄ ✄ ✆ ✢ ☎ ✆ ✟ ☞ ✠ ✡ ✝ � ☛☞ ✞ �✟ ✠ ✡ ✟ ✢ �✂✁ ✌✎✍ ✞✠✟✡ ✬✎✭ ✰✎✵ ✮✠✯ String�Operations. MOVS : Moves�a�byte,�word�or�doubleword�from�data�segment�and�offset� SI � to�extra�segment�and�offset� DI . Increments/decrements�both� DI �and� SI : MOVSB ✍✏✎ ✍✏✎ MOVSD ✍✏✎ ✍✏✎ MOVS ✍✏✎ ✍✏✎ INS/OUTS �(not�available�on�the�8086): Transfers�a�byte,�word�or�doubleword�of�data�from/to�an�I/O�device� into/outof�the�extra/data�segment�+�offset� DI / SI ,�respectively. The�I/O�address�is�stored�in�the� DX �register. INSB ✍✏✎ INSD ✍✏✎ ✍✏✎ ✍✏✎ OUTSB ✍✏✎ UMBC L A N R Y D A B M A L F T U M B C I 5 O M O Y T R ✔✎✣ ✑✦✥ ✧✎★ I E S R C E O V U I N N U T Y 1 6 9 6

  6. ☎ ✠ ✟ ✍ ✌ ✙ ☛ ✍ ✖ ✛ ✙ ✗ ✒ ✙ ✞ ✔ ✛ ✛ ✚ ✙ ✎ ✎ ✜ ✄ ✑ ✁ ✗✘ ☎ ✢ � ✚ ✂ ✟ ☛ ✕ ✄ ✛ ✛ ✚ ✙ ✎ ✎ ✔ ✴ ✁ ✳ ✯ ✲ ✲ ✰✱ ✚ ✔ � ✄ ✜ ✄ ✁ ✙ ☎ ✁ ✔ ✛✜ ✄ ✙ ✘ ✗ ✁ ✕✖ ✝ ✆ ✄ ✄ ✏✓ ✢ ✒ ✏✑ ☛ ✝ ✝ ✟☞ ☛ ✄ ✝ ✆ ☎ ✑ ✞✚ ✡ ✄ ✖ ✡ ✡ ✔ ✙ ✫ ✝ ☞ ✩✪ ☎ ✙ ✔ ✜ ✑ ✑ ✤ ✂ ✜ ✖✤ ✌ ✟ ✛ �✂✁ ✌✎✍ ✞✠✟✡ ✬✎✭ ✰✎✵ ✮✠✯ String�Operations. INS �Example: ... LEA DI MOV DX CLD MOV CX ... NOTE:� This�assumes�the�device�is�able�to�make�data�available�at�the�speed�of� the�program,�and�in�sync�with�the�program. Since�this�is�almost�never�true,�the�code�above�needs�to�have�a� “device�status�check”�instruction(s). Of�course,�the� REP �prefix�can�not�be�used�in�this�case. The�same�holds�true�for� OUTS �instructions. UMBC L A N R Y D A B M A L F T U M B C I 6 O M O Y T R ✔✎✣ ✑✦✥ ✧✎★ I E S R C E O V U I N N U T Y 1 6 9 6

Recommend


More recommend