





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






REG, memory memory, REG REG, REG memory, immediate REG, immediate
SREG, memory memory, SREG REG, SREG SREG, REG
Copy operand2 to operand1.
The MOV instruction cannot:
Algorithm: operand1 = operand
Ex: Mov AX,BX ;Copy contents of BX to AX
Memory
Unsigned Multiply. Multiply the contents of REG/Memory with contents of AL register. Algorithm:
When operand is a byte: AX = AL * operand.
When operand is a word: (DX: AX) = AX * operand.
REG, memory memory, REG REG, REG memory, immediate REG, immediate
Compare.
Algorithm: operand1 - operand
Result is not stored anywhere, flags are set (OF, SF, ZF, AF, PF, CF) according to result.
JMP Label
Unconditional Jump.
Transfers control to another part of the program. 4-byte address may be entered in this form: 1234h: 5678h, first value is a segment second value is an offset.
Algorithm: always jump
JA Label
Jump If Above.
Short Jump if first operand is Above second operand (as set by CMP instruction). Unsigned.
Algorithm: if (CF = 0) and (ZF = 0) then jump
JAE Label
Jump If Above Or Equal
Short Jump if first operand is Above or Equal to second operand (as set by CMP instruction). Unsigned. Algorithm:
if CF = 0 then jump
JB Label
Jump If Below.
Short Jump if first operand is Below second operand (as set by
CMP instruction). Unsigned.
Algorithm:
if CF = 1 then jump
JBE Label
Jump If Below Or Equal
Short Jump if first operand is Below second operand (as set by CMP instruction). Unsigned.
Algorithm:
if CF = 1 then jump
JC Label
Jump If Carry
Short Jump if Carry flag is set to 1.
Algorithm:
if CF = 1 then jump
JE Label
Jump If Equal.
Short Jump if first operand is Equal to second operand (as set by CMP instruction). Signed/Unsigned.
Algorithm:
if ZF = 1 then jump
JG Label
Jump If Greater
Short Jump if first operand is Greater then second operand (as set by CMP instruction). Signed.
Algorithm:
if (ZF = 0) and (SF = OF) then jump
JGE Label
Jump If Greater Or Equal.
Short Jump if first operand is Greater or Equal to second operand (as set by CMP instruction). Signed.
Algorithm:
if SF = OF then jump
JL Label
Jump If Less than.
Short Jump if first operand is Less then second operand (as set by CMP instruction). Signed.
Algorithm:
if SF <> OF then jump
JLE Label
Jump If Less Or Equal.
Short Jump if first operand is Less or Equal to second operand (as set by CMP instruction). Signed.
Algorithm:
OR REG, memory memory, REG REG, REG memory, immediate REG, immediate
Logical OR between all bits of two operands. Result is stored in first operand.
These rules apply:
1 OR 1 = 1; 1 OR 0 = 1 0 OR 1 = 1; 0 OR 0 = 0
REG, memory memory, REG REG, REG memory, immediate REG, immediate
Subtract.
Algorithm:
operand1 = operand1 - operand
DAA No Operands
Decimal adjust After Addition. Corrects the result of addition of two packed BCD values.
Algorithm: if low nibble of AL > 9 or AF = 1 then:
if AL > 9Fh or CF = 1 then:
DAS No Operands
Decimal adjust After Subtraction. Corrects the result of subtraction of two packed BCD values.
Algorithm: if low nibble of AL > 9 or AF = 1 then:
if AL > 9Fh or CF = 1 then:
memory
Increment.
Algorithm: operand = operand + 1
Memory
Decrement.
Algorithm: operand = operand – 1
Memory
Unsigned Divide.
Algorithm:
when operand is a byte: AL = AX / operand AH = remainder (modulus) when operand is a word: AX = (DX AX) / operand DX = remainder (modulus)
memory, immediate REG, immediate
memory, CL REG, CL
Shift Left.
Shift operand1 Left. The number of shifts is set by operand2.
Algorithm:
memory, immediate REG, immediate
memory, CL REG, CL
Shift Right.
Shift operand1 Right. The number of shifts is set by operand2.
Algorithm:
memory, immediate REG, immediate
memory, CL REG, CL
Rotate Left.
Rotate operand1 left. The number of rotates is set by operand2.
Algorithm:
Shift all bits left, the bit that goes off is set to CF and the same bit is inserted to the right-most position.
memory, immediate REG, immediate
memory, CL REG, CL
Rotate Right.
Rotate operand1 right. The number of rotates is set by operand2.
Algorithm:
Shift all bits right, the bit that goes off is set to CF and the same bit is inserted to the left-most position.
CALL
procedure name label
Transfers control to procedure, return address is (IP) pushed to stack.
RET No operands Or even immediate date
Return from near procedure.
Algorithm:
if immediate operand is present: SP = SP + operand
AL, im.byte AL, DX AX, im.byte AX, DX
Input from port Into AL or AX. Second operand is a port number. If required to access port number over 255 - DX register should be used.
AL, im.byte AL, DX AX, im.byte AX, DX
Output from AL or AX to port. First operand is a port number. If required to access port number over 255 - DX register should be used.
AAS No Operands
Algorithm:
if low nibble of AL > 9 or AF = 1 then:
else
in both cases: cLear the high nibble of AL.
Example: MOV AX, 02FFh ; AH = 02, AL = 0FFh AAS ; AH = 01, AL = 09
AAM No Operands
ASCII Adjust after Multiplication. Corrects the result of Multiplication of two BCD values.
Algorithm:
Example: MOV AL, 15 ; AL = 0Fh AAM ; AH = 01, AL = 05