written 5.9 years ago by | • modified 5.7 years ago |
a) CMPSB
b) DIV AX
c) LOOPE again
d) REP SCASB
e) XLATB
Mumbai University > Electronics and Telecommunication > Sem 4 > Microprocessor and peripherals
written 5.9 years ago by | • modified 5.7 years ago |
a) CMPSB
b) DIV AX
c) LOOPE again
d) REP SCASB
e) XLATB
Mumbai University > Electronics and Telecommunication > Sem 4 > Microprocessor and peripherals
written 5.7 years ago by | • modified 5.7 years ago |
CMPSB-
Mnemonic: CMPSB (compare string byte)
Algorithm:
DS: [SI] – ES: [DI]
Set flags according to result → OF, SF, ZF, AF, PF, CF
If DF = 0 then
SI = SI + 1
DI = DI + 1 else
SI = SI – 1
DI = DI – 1
Operation:
DIV AX:-
Mnemonic: DIV AX
Algorithm: AX = (DX: AX)/operand (Quotient)
DX = remainder (Modulus)
Operation:
DIV AX
LOOPE again:-
Mnemonic: Loop while CX ≠ 0 and ZF = 1
LOOPE again
Algorithm: CX = CX – 1
If CX ≠ 0 and ZF = 1 then jump else no jump
Operation:
REP:-
Mnemonic: REP
Operation:
The above section of a program will cause the following string operation
ES: [DI] ← DS: [SI]
SI ← SI + I
DI ← DI + I
CX ← CX – 1
to be executed 23H times (as CX = 23H) in auto incrementing mode (as DF is cleared).
SCASB:-
Mnemonic: SCASB (for byte operation)
Algorithm: For SCASB
AL – ES: [DI]
Set flags according to result
If DF = 0 then DI = DI + 1
Operation:
XLATB:-
Mnemonic: XLATB (B indicates byte operation)
Algorithm: AL = DS: [BX + unsigned AL]
Operation:
AL ← DS: [BX + AL]