| String Instructions | |||||
| Name | Description | Code | Operation | operands | operand size |
|---|---|---|---|---|---|
| movs | Move string | movs | dest = source | ||
| movsb movsw movsd |
|||||
| movs byte dest,source movs word dest,source movs dword dest,source |
[es:di],[s_reg:si] [es:edi],[s_reg:esi] |
byte word dword |
|||
| cmps | Compare string | cmps | dest - source, (updat A,S,P,C,O) |
||
| cmpsb cmpsw cmpsd |
|||||
| cmps byte source,dest cmps word source,dest cmps dword source,dest |
[s_reg:si],[es:di] [s_reg:esi],[es:edi] |
byte word dword |
|||
| scas | Scan string | scas | dest - al/ax/eax, (updat A,S,P,C,O) |
||
| scasb scasw scasd |
|||||
| scas byte dest scas word dest scas dword dest |
[di] [edi] [es:di] [es:edi] |
byte word dword |
|||
| lods | Load string | lods | al/ax/eax = source | ||
| lodsb lodsw lodsd |
|||||
| lods byte source lods word source lods dword source |
[s_reg:si] [s_reg:esi] |
byte word dword |
|||
| stos | Store string | stos | dest = al/ax/eax | ||
| stosb stosw stosd |
|||||
| stos byte dest stos word dest stos dword dest |
[di] [edi] [es:di] [es:edi] |
byte word dword |
|||
| ins | Input string from port | ins | port -> dest | ||
| insb insw insd |
|||||
| ins byte dest,port ins word dest,port ins dword dest,port |
[di],dx [edi],dx |
||||
| outs | Output string to port | outs | source -> port | ||
| outsb outsw outsd |
|||||
| outs port,byte source outs port,word source outs port,dword source |
dx,[si] dx,[esi] dx,[s_reg:si] dx,[s_reg:esi] |
||||
| rep | Repeat while ECX not zero | rep <string operation> | dec cx/ecx, repeat until cx/ecx=0 |
||
| repe repz |
Repeat while equal Repeat while zero |
repz <string operation> repe <string operation> |
dec cx/ecx, repeat until cx/ecx=0 or ZF=0 |
||
| repne repnz |
Repeat while not equal Repeat while not zero |
repnz <string operation> repne <string operation> |
dec cx/ecx, repeat until cx/ecx=0 or ZF=1 |
||