(a) Serial operation instruction and repeat prefix one, the string operation instruction: 1, the string transmission instruction:
(1) instruction format:
MOVS DST,RSCMOVSB ; Es:[di]<--ds:[si],si<-si+/-1, di<-di+/-1 MOVSW ; Es:[di]<--ds:[si];si<-si+/-2, di<-di+/-2
(2) Instruction function:
A, transfer an element of the source string to the corresponding location of the destination string.
B, the following two types are mainly by byte or by word transmission
2. Serial Loading Instructions
(1) instruction format:
lods SRCLODSB ; AL<-ds:[si],si+/-1lodsw ; AX<ds:[si],si+/-2
(2) Instruction function:
Passing an element of the source string to the accumulator
3. Serial Storage Instructions
(1) instruction format:
STOs DST
STOSB ; es:[di]<-al,di<-di+/-1
STOSW ; es:[di]<-al,di<-di+/-2
(2) Instruction function:
Transfers the value of the accumulator to an element position in the destination string
4. Serial comparison Instruction
(1) instruction format:
CMPS src,dstcmpsb ;D s:[si]-es:[si],si<-si+/-1, di<--di+/-1CMPSW ;D S:[si]-es:[di],si<--si+/-2, di<--di+/-2
(2) Command function
A, the two string corresponding position of the elements are compared, that is, to reduce the operation, the result is not loopback, but affect 6 flag bits
B, the source operand of the string comparison instruction is the meiosis, the purpose operand is the number of pieces.
5. Serial Search Instructions
(1) instruction format:
SCAS SRC,DSTSCASB ; Al-es: [di],di<-di+/-1
SCASW ; Al-es: [di],di<-di+/-2
(2) Instruction function:
With the accumulator al or Ax as the meiosis, with an element of the string see, no return results, single impact 6 flag bits
Second, string repeat prefix 1, instruction format:
REP ; If CX is not equal to 0, a string operation is performed, cx<-cx-1
If CX equals 0, end string operation
Pepr or prez ; if CX is not equal to 0 and zf=1, the string operation is performed, cx<-cx-1
If cx=0 or zf=0, end string operation
Repne or REPNZ ; if CX is not equal to 0 and zf=0, the string operation is performed, cx<-cx-1
If Cx=0 or zf=1, the end string operation
2. Note:
(1) Before using any one string operation instruction, it must be modified according to the direction of the change of the string address to the flag DF.
CLD to the flag DF Clear 0, that is, the string operation for the addition of STD to the flag DF Set 1, that is, the string operation to reduce
(2) before using Movs,lods,cmos, to initialize the DS and Si, the ES and DI initialization before using Movs,stos,cmps,scas
(3) If both the source string and the destination string are in the same segment, ES and DS are initialized to the same value.
(ii) unsigned number and signed number conditional jump instruction one, unsigned number conditional jump instruction
Two, signed number jump instruction
Compilation Learning (v)-table handlers