8086 Instructions (Compact)

zhaozj2021-02-16  60

ADDADCINC SUBSBBDEC NEGCMP MULIMUL DAADASAAAAAS ANDORXORNOTTEST SHLSHRSALSAR ROLRORRCLRCR MOVMOVSBMOVSWSTOSBSTOSWLODSBLODSWREPCLDSTD CMPSBCMPSWSCASBSCASWREPEREPNEREPZREPNZ IN OUT JMPJZJNZJSJNSJOJNOJPJNPJBJNB

Status Sign Description: 1 - Instruction Set This flag bit is 1 0 - instruction Set the value of this flag bit to 0 R - flag bit depends on the return finger of the instruction. - The value of the flag bit is uncertain (1 or 0 is possible) Instruction Operation Description Add

REG, MEMORY

Memory, REG

REG, REG

Memory, Immediate

REG, IMMEDIATE

Add. Algorithm: operand1 = OPERAND1 OPERAND2 EXAMPLE: MOV Al, 5; Al = 5 Add Al, -3; Al = 2 RET

CZSOPARRRRR ADC

REG, MEMORY

Memory, REG

REG, REG

Memory, Immediate

REG, IMMEDIATE

Add with carry. Algorithm: operand1 = OPERAND1 OPERAND2 CF EXAMPLE: STC; SET CF = 1 MOV Al, 5; Al = 5 ADC Al, 1; Al = 7 RET

CZSOPARRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR INC

REG

Memory

INCREMENT. Algorithm: Operand = Operand 1 Example: MOV Al, 4 Inc Al; Al = 5 RET

ZsoParrrr Cf - Unchanged! SUB

REG, MEMORY

Memory, REG

REG, REG

Memory, Immediate

REG, IMMEDIATE

Subtract. Algorithm: Operand1 = OPERAND1 - OPERAND2 EXAMPLE: MOV AL, 5 SUB Al, 1; Al = 4 RET

CzsoParrrrrr SBB

REG, MEMORY

Memory, REG

REG, REG

Memory, Immediate

REG, IMMEDIATE

Subtract with borrow. Algorithm: Operand1 = OPERAND1 - OPERAND2 - CF EXAMPLE: STC MOV Al, 5 SBB AL, 3; Al = 5 - 3 - 1 = 1 Ret

CZSOPARRRRRR DEC

REG

Memory

Decrement. Algorithm: Operand = OPERAND - 1 Example: MOV Al, 255; Al = 0FFH (255 OR-1) DEC Al; Al = 0FEH (254 OR-2) RET

ZsoParrrr Cf - Unchanged! NEG

REG

Memory

NEGATE. MAKES OPERAND NEGATIVE (Two's Complement). Algorithm:

Invert All Bits of the Operandd 1 To Inverted Operand Example: MOV Al, 5; Al = 05H NEG AL; Al = 0FBH (-5) NEG Al; Al = 05H (5) Retczsoparrrrr CMP

REG, MEMORY

Memory, REG

REG, REG

Memory, Immediate

REG, IMMEDIATE

Compare. Algorithm: Operand1 - Operand2 Result Is Not Stored Anywhere, Flags Are Set (Of, SF, ZF, AF, PF, CF) According to Result. EXAMPLE: MOV Al, 5 MOV BL, 5 CMP AL, BL; Al = 5, zf = 1 (so equal!) RET

CZSOPARRRRR MUL

REG

Memory

Unsigned Multiply. Algorithm:

When Operand Is A

BYTE:

AX = Al * Operand.

When Operand is a word:

(DX AX) = ax * operand.

Example: MOV Al, 200; Al = 0C8H MOV BL, 4 MUL BL; AX = 0320H (800) RET

CZSOPAR ?? r ?? cf = of the result is zero. Imul

REG

Memory

Signed Multiply. Algorithm:

When Operand is a byte:

AX = Al * Operand.

When Operand is a word:

(DX AX) = ax * operand.

EXAMPLE: MOV Al, -2 MOV BL, -4 Imul BL; AX = 8 RET

CZSOPAr ?? r ?? CF = OF = 0 when result fits into operand of IMUL 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:

Al = Al 6AF = 1 if Al> 9fh or cf = 1 THEN:

Al = Al 60HCF = 1 EXAMPLE: MOV Al, 0FH; Al = 0FH (15) DAA; Al = 15h RET

CZSOPARRRRR DAS No Operands Decimal Adjust After Subtraction of Two Packed BCD Values. Algorithm: if Low Nibble of Al> 9 OR AF = 1 THEN:

Al = Al - 6AF = 1 IF al> 9fh or cf = 1 THEN:

Al = Al - 60HCF = 1 Example: MOV Al, 0FFH; Al = 0FFH (-1) DAS; Al = 99H, CF = 1 Retczsoparrrrr AAA No Operands ASCII Adjust After Addition. CORRECTS RESULT IN AH AND Al After ADDITION WHEN WORKING WITH BCD VALUES. It works According to the Following Algorithm: if Low Nibble of Al> 9 OR AF = 1 THEN:

Al = Al 6ah = AH 1AF = 1cf = 1 else

AF = 0cf = 0 in Both Case: Cairs the high Nibble of Al. EXAMPLE: MOV AX, 15; AH = 00, Al = 0FH AAA; AH = 01, Al = 05 RET

CZSOPAR ???? R AAS No Operands ASCII Adjust After Subtraction. CORRECTS RESULT IN AH AND Al After Subtraction WHEN WORKING WITH BCD VALUES. Algorithm: if Low Nibble of Al> 9 OR AF = 1 Then:

Al = Al - 6ah = ah - 1AF = 1cf = 1 else

AF = 0cf = 0 in Both Case: Cases: Cairs the High Nibble of Al. EXAMPLE: MOV AX, 02FFH; AH = 02, Al = 0FFH AAS; AH = 01, Al = 09 RET

CZSOPAR ???? r and

REG, MEMORY

Memory, REG

REG, REG

Memory, Immediate

REG, IMMEDIATE

Logical and Between All Bits of Two Operands. Result is Stored IN OPERAND1. THESE RULES APPLY: 1 and 1 = 1 1 and 0 = 0 0 and 1 = 0 0 = 0 Example: MOV Al, 'A'; Al = 01100001B and Al, 1101111B; Al = 01000001B ('a') RET

CZSOP0RR0R OR 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. Thase Rules Apply: 1 OR 1 = 1 1 OR 0 = 0 OR 1 = 1 0 OR 0 = 0 Example: MOV Al, 'A'; Al = 01000001B or Al, 00100000B; Al = 01100001B ('a') RET

CZSOPA0R0R? Xor

REG, MEMORY

Memory, Regreg, REG

Memory, Immediate

REG, IMMEDIATE

Logical XOR (Exclusive OR) Between All Bits of Two Operands. Result is Stored In First Operand. Thase Rules Apply: 1 xor 1 = 0 1 xor 0 = 1 0 xor 1 = 1 0 xor 0 = 0 Example: MOV Al, 00000111B XOR Al, 00000010B; Al = 00000101B RET

CZSOPA0RR0R? NOT

REG

Memory

Invert Each Bit of the Operand. Algorithm:

If Bit IS 1 Turn It TO 0. If Bit IS 0 Turn It TO 1. EXAMPLE: MOV Al, 00011011B Not Al; Al = 11100100B Ret

CZSOPAunchanged Test

REG, MEMORY

Memory, REG

REG, REG

Memory, Immediate

REG, IMMEDIATE

Logical and Between All Bits Of Two Operands for Flags ONLY. THESE FLAGS Are Effected: ZF, SF, PF. Result IS NOT Stored Anywhere. These Rules Apply: 1 and 1 = 1 1 and 0 = 0 0 and 1 = 0 0 0 = 0 EXAMPLE: MOV Al, 00000101B Test Al, 1; ZF = 0. Test Al, 10B; ZF = 1. Ret

CZSOP0RR0R SHL

Memory, Immediate

REG, IMMEDIATE

Memory, Cl

REG, CL

Shift Operand1 Left. The number of shifts is set by operand2. Algorithm:

SHIFT All Bits LEFT, The Bit That Goes Off Is TO CF.ZERO BIT IS ISERTED TO CF.ZERO BIT POSITION. EXAMPLE: MOV AL, 11100000B SHL Al, 1; Al = 11000000B, CF = 1. RET

Corr of = 0 if first Operand Keeps Original Sign. SHR

Memory, Immediate

REG, IMMEDIATE

Memory, Cl

REG, CL

Shift Operand1 Right. The number of shifts is set by operand2. Algorithm:

Shift All Bits Right, The Bit That Goes OFF ISET TO CF.ZERO BIT IS ISERTED to CF. izero bit is inserted to the left-most position. EXAMPLE: MOV Al, 00000111B SHR Al, 1; Al = 00000011B, CF = 1. RET

Corr of = 0 if first Operand Keeps Original Sign. Sal

Memory, Immediate

REG, IMMEDIATE

Memory, Cl

REG, CL

Shift Arithmetic operand1 Left The number of shifts is set by operand2 Algorithm: Shift all bits left, the bit that goes off is set to CF.Zero bit is inserted to the right-most position Example:... MOV AL, 0E0h; AL = 11100000B Sal Al, 1; Al = 11000000B, CF = 1. Ret

Corr of = 0 if First Operand Keeps Original Sign. SAR

Memory, Immediate

REG, IMMEDIATE

Memory, Cl

REG, CL

Shift Arithmetic Operand1 Right. The number of shifts is set by operand2. Algorithm:

SHIFT All Bits Right, The Bit That Bit That IS ISERTED TO CF.THE SIGN BIT THAT THAT THATED. EXAMPLE: MOV Al, 0E0H; Al = 11100000B SAR AL, 1 Al = 11110000B, CF = 0. MOV BL, 4CH; BL = 01001100B SAR BL, 1; BL = 00100110B, CF = 0. RET

Corr of = 0 if first Operand Keeps Original Sign. ROL

Memory, Immediate

REG, IMMEDIATE

Memory, Cl

REG, CL

Rotate Operand1 Left. The number of rotates is set by operand2. Algorithm:

SHIFT All Bits Left, The Bit That Goes Off Is Insert To The Right-Most Position.

EXAMPLE: MOV Al, 1CH; Al = 00011100B ROL Al, 1; Al = 00111000B, CF = 0. Ret

Corr of = 0 if First Operand Keeps Original Sign. ROR

Memory, Immediate

REG, IMMEDIATE

Memory, Cl

REG, CL

Rotate Operand1 Right. The number of rotates is set by operand2. Algorithm:

Shift All Bits Right, The Bit That Goes Off Is Insert To The Left-Most Position.

EXAMPLE: MOV Al, 1CH; Al = 00011100B ROR Al, 1; Al = 00001110B, CF = 0. RET

Corr of = 0 if first Operand Keeps Original Sign. RCL

Memory, Immediate

REG, IMMEDIATE

Memory, Cl

REG, CL

Rotate operand1 left through Carry Flag. The number of rotates is set by operand2. When immediate is greater then 1, assembler generates several RCL xx, 1 instructions because 8086 has machine code only for this instruction (the same principle works for all other shift / Rotate Instructions. Algorithm: Shift All Bits Left, The Bit That Goes Off Is Set To Cf and Previous Value of Cf Is Inserted to The Right-Most Position.

EXAMPLE: STC; SET Carry (CF = 1). MOV Al, 1CH; Al = 00011100B RCL Al, 1; Al = 00111001B, CF = 0. RET

Corr of = 0 if first Operand Keeps Original Sign. RCR

Memory, Immediate

REG, IMMEDIATE

Memory, Cl

REG, CL

Rotate Operand1 Right Through Carry Flag. The number of rotates is set by operand2. Algorithm:

Shift All Bits Right, The Bit That Goes Off Is Set To Cf and Previous Value of Cf is inserted to The Left-Most Position.

EXAMPLE: STC; SET Carry (CF = 1). MOV Al, 1CH; Al = 00011100B RCR Al, 1; Al = 10001110B, CF = 0. Ret

Corr of = 0 if first Operand Keeps Original Sign. MOV

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:

. Set the value of the CS and IP registers.copy value of one segment register to another segment register (should copy to general register first) .copy immediate value to segment register (should copy to general register first) Algorithm:

OPERAND1 = OPERAND2

Example: # Make_com # ORG 100H MOV AX, 0B800H; SET AX = B800H (VGA Memory). MOV DS, AX; Copy Value of Ax To DS. MOV CL, 'A'; CL = 41H (ASCII CODE). MOV Ch , 01011111b; CL = color attribute. MOV BX, 15EH; bx = position on screen. MOV [BX], CX; W. [0B800H: 015EH] = CX. Ret; returns to operation system.czsopaunchanged Movsb No Operands Copy Byte AtTe DS: [Si] To Es: [di]. Update Si and Di. Algorithm:

ES: [DI] = DS: [Si] IF DF = 0 THEN

Si = Si 1Di = DI 1 ELSE

Si = Si - 1Di = di - 1 Example: # Make_com # ORG 100H Lea Si, A1 Lea Di, A2 MOV CX, 5 Rep Movsb Ret A1 DB 1, 2, 3, 4, 5 A2 DB 5 DUP (0)

CZSOPAunchanged Movsw No Operands Copy Word At DS: [Si] To Es: [Di]. Update Si and Di. Algorithm:

ES: [DI] = DS: [Si] IF DF = 0 THEN

Si = Si 2DI = DI 2 ELSE

Si = Si - 2di = di - 2 example: # make_com # org 100h Lea Si, A1 Lea Di, A2 MOV CX, 5 Rep Movsw Ret A1 DW 1, 2, 3, 4, 5 A2 DW 5 DUP (0)

CzsoPaunchanged Stosb No Operands Store Byte in Al Into ES: [DI]. Update Si. Algorithm:

ES: [di] = al if DF = 0 THEN

Di = DI 1 ELSE

Di = DI - 1 Example: # Make_com # ORG 100H Lea Di, A1 MOV Al, 12H MOV CX, 5 Rep Stosb Ret A1 DB 5 DUP (0)

CZSopaunchanged Stosw No Operands Store Word In Ax Into ES: [DI]. Update Si. Algorithm:

ES: [DI] = AX if DF = 0 THEN

Di = DI 2 ELSE

Di = DI - 2 Example: # Make_com # ORG 100H Lea Di, A1 MOV AX, 1234H MOV CX, 5 Rep Stosw Ret A1 DW 5 DUP (0)

CZSOPAunchanged Lodsb No Operands Load Byte At DS: [Si] INTO Al. Update Si. Algorithm:

Al = DS: [Si] IF DF = 0 THEN

Si = Si 1 ELSE

Si = Si - 1 Example: # Make_com # ORG 100H Lea Si, A1 MOV CX, 5 MOV AH, 0EH M: LODSB INT 10H LOOP M RET A1 DB 'H', 'E', 'L', 'L', 'O'czsoPaunchanged Lodsw No Operands Load Word AT DS: [Si] INTO AX. Update Si. Algorithm:

AX = DS: [Si] IF DF = 0 THEN

Si = Si 2 ELSE

Si = Si - 2 EXAMPLE: # Make_com # ORG 100H Lea Si, A1 MOV CX, 5 Rep Lodsw; Finally There Will BE 555H in Ax. Ret A1 DW 111H, 222H, 333H, 444H, 555H

CZSOPAunchanged Rep

Chain Instruction

REPEAT FOLLOWING MOVSB, MOVSW, LODSB, LODSW, Stosb, Stosw instructions cx Times. Algorithm: Check_CX: IF CX <> 0 THEN

Do Following Chain Instructioncx = CX - 1GO Back to Check_CX Else

EXIT from rep Cycle

ZR CLD No Operands Clear Direction Flag. Si and Di Will Be Increment by Chain Instructions: Cmpsb, Cmpsw, Lodsb, Lodsw, Movsb, Movsw, Stosb, Stosw. Algorithm: DF = 0

D0 Std No Operands Set Direction Flag. Si and Di Will Be Decrement by Chain Instructions: CMPSB, Cmpsw, Lodsb, Lodsw, Movsb, Movsw, Stosb, Stosw. Algorithm: DF = 1

D1 Cmpsb No Operands Compare Bytes:

ES: [DI] from DS: [Si].

Algorithm:

DS: [Si] - ES: [DI] Set Flags According To Result: of, SF, ZF, AF, PF, CF IF DF = 0 THEN

Si = Si 1Di = DI 1 ELSE

Si = Si - 1Di = di - 1 Example: See Cmpsb.asm in Samples.

CZSOPARRRRR CMPSW No Operands Compare Words:

ES: [DI] from DS: [Si].

Algorithm:

DS: [Si] - ES: [DI] Set Flags According To Result: of, SF, ZF, AF, PF, CF IF DF = 0 THEN

Si = Si 2DI = DI 2 ELSE

Si = Si - 2di = di - 2 Example: See cmpsw.asm in samples.

CZSOPARRRRR SCASB No Operands Compare Bytes:

Al from ES: [Di] .algorithm:

ES: [DI] - Al Set Flags According To Result: of, SF, ZF, AF, PF, CF IF DF = 0 THEN

Di = DI 1 ELSE

Di = di - 1

CZSOPARRRRR SCASW No Operands Compare Words:

Ax from ES: [DI].

Algorithm:

ES: [DI] - AX Set Flags According To Result: of, SF, ZF, AF, PF, CF IF DF = 0 THEN

Di = DI 2 ELSE

Di = di - 2

CZSOPARRRRR REPE

Chain Instruction

REPEAT FOLLOWING CMPSB, CMPSW, ScaSB, Scasw ISTRUCTIONS WHILAL, MAXIMUM CX TIMES. Algorithm: Check_cx: IF CX <> 0 THEN

Do Following Chain Instructioncx = CX - 1IF ZF = 1 THEN:

Go Back to Check_CX ELSE

EXIT from REPE CYCLE ELSE

EXIT from REPE CYCLE EXAMPLE: See Cmpsb.asm in Samples.

Zr repne

Chain Instruction

REPEAT FOLLOWING CMPSB, CMPSW, SCASB, Scasw instructions while zf = 0 (Result is not equals, maximum cx Times. Algorithm: Check_cx: IF CX <> 0 THEN

Do Following Chain Instructioncx = CX - 1IF ZF = 0 THEN:

Go Back to Check_CX ELSE

EXIT from Repne Cycle Else

Exit from repne Cycle

ZR REPZ

Chain Instruction

REPEAT FOLLOWING CMPSB, CMPSW, SCASB, Scasw instructions while zf = 1 (Result is Zero), Maximum CX Times. Algorithm: Check_Cx: IF CX <> 0 THEN

Do Following Chain Instructioncx = CX - 1IF ZF = 1 THEN:

Go Back to Check_CX ELSE

Exit from repz Cycle Else

Exit from repz Cycle

Zr repnz

Chain Instruction

REPEAT FOLLOWING CMPSB, CMPSW, SCASB, Scasw instructions while zf = 0 (Result is not zero), Maximum CX Times. Algorithm: Check_CX: IF CX <> 0 THEN

Do Following Chain Instructioncx = CX - 1IF ZF = 0 THEN:

Go Back to Check_CX ELSE

EXIT from RepNZ Cycle Else

EXIT from RepNZ Cyclezr in

Al, Im.byte

Al, DX

AX, Im.byte

AX, DX

Input from port INTO Al OR AX. Second operand is a port number over 505 - dx register surplend. EXAMPLE: IN AX, 4; Get Status of Traffic Lights. In Al, 7; Get Status Of Stepper-Motor.

CzsoPaunchanged Out

Im.byte, al

Im.byte, AX

DX, Al

DX, AX

Output from al or ax number. If Required to access port number over 255 - dx register shouth. EXAMPLE: MOV AX, 0FFFH; Turn ON All Out 4, Ax; Traffic Lights. Mov Al , 100b; Turn on The Third OUT 7, Al; Magnet of The Stepper-Motor.

CZSOPAunchanged JMP

label

4-byte address

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

EXAMPLE: INCLUDE 'EMU8086.INC' # Make_com # ORG 100H MOV Al, 5 JMP Label1; Jump Over 2 Lines! Print 'Not Jumped!' MOV Al, 0 Label1: Print 'Got Here!' Ret

CZSOPAunchanged JZ

label

SHORT JUMP IF ZERO (Equal). Set by CMP, SUB, ADD, TEST, AND, OR, XOR INSTRUCTIONS. Algorithm:

IF zf = 1 THEN JUMP

Example: include 'emu8086.inc' # Make_com # ORG 100H MOV Al, 5 CMP AL, 5 JZ Label1 Print 'Al Is Not Equal to 5.' JMP Equal to 5. 'EXIT: RET

CzsoPaunchanged JNZ

label

SHORT JUMP IF NOT ZERO (NOT Equal). Set by CMP, Sub, Add, Test, And, OR, XOR Instructions. Algorithm:

IF zf = 0 THEN JUMP

EXAMPLE: INCLUDE 'EMU8086.INC' # Make_com # ORG 100H MOV Al, 00000111b; Al = 7 OR Al, 0; Just Set Flags. JNZ Label1 Print 'Zero.' JMP EXIT Label1: Print 'Not Zero.' EXIT: RETCZSOPAUNCHANGED JS

label

Short Jump if Signed (if NEGATIVE). Set by CMP, SUB, Add, Test, And, OR, XOR Instructions. Algorithm:

IF sf = 1 THEN JUMP

EXAMPLE: INCLUDE 'EMU8086.INC' # MAKE_COM # ORG 100H MOV Al, 10000000B; Al = -128 OR Al, 0; Just Set Flags. JS Label1 Print 'Not Signed.' JMP EXIT Label1: Print 'Signed.' Exit: RET

CZSOPAunchanged JNS

label

Short jump if not sign (if posight). Set by CMP, SUB, Add, Test, And, OR, XOR Instructions. Algorithm:

IF sf = 0 THEN JUMP

EXAMPLE: INCLUDE 'EMU8086.INC' # Make_com # ORG 100H MOV Al, 00000111b; Al = 7 OR Al, 0; Just Set Flags. JNS Label1 Print 'Signed.' JMP EXIT Label1: Print 'Not Signed.' EXIT: RET

CZSOPAunchanged Jo

label

Short jump if overflow. Algorithm:

IF of = 1 THEN JUMP

Example:; -5 - 127 = -132 (not in -128..127); The Result of Sub is WRONG (124),; SO of = 1 is set: include 'EMU8086.Inc' # Make_com # org 100h MOV Al, -5 SUB Al, 127; Al = 7CH (124) JO Label1 Print 'No overflow.' JMP EXIT Label1: Print 'overflow!' EXIT: RET

CzsoPaunchanged JNO

label

Short jump if not overflow. Algorithm:

IF of = 0 THEN JUMP

EXAMPLE:; -5 - 2 = -7 (Inside -128..127); The result of sub is is correct,; so of = 0: include 'emu8086.inc' # make_com # org 100h MOV Al, -5 SUB Al , 2; Al = 0F9H (-7) JNO Label1 Print 'overflow!' JMP EXIT Label1: Print 'No overflow.' EXIT: RET

CZSOPAunchanged JP

Labelshort Jump if Parity (Even). Only 8 Low Bits of Result Are Checked. Set by Cmp, Sub, Add, Test, And, OR, XOR INSTRUCTIONS. Algorithm:

IF pf = 1 THEN JUMP

EXAMPLE: INCLUDE 'EMU8086.INC' # MAKE_COM # ORG 100H MOV Al, 00000101B; Al = 5 or Al, 0; Just Set Flags. JP Label1 Print 'Parity ODD.' JMP EXIT Label1: Print 'Parity Even.' Exit: RET

CZSOPAunchanged JNP

label

SHORT JUMP IF NO PARITY (ODD). Only 8 Low Bits of Result Are Cmp, Sub, Add, Test, And, OR, XOR INSTRUCTIONS. Algorithm:

IF pf = 0 THEN JUMP

EXAMPLE: INCLUDE 'EMU8086.INC' # Make_com # ORG 100H MOV Al, 00000111b; Al = 7 OR Al, 0; Just Set Flags. JNP Label1 Print 'Parity Even.' JMP EXIT Label1: Print 'Parity Odd.' Exit: RET

CZSOPAunchanged JB

label

SHORT JUMP if First Operand is Below Second Operand (as set by cmp instruction). Unsigned. Algorithm:

IF cf = 1 THEN JUMP

EXAMPLE: INCLUDE 'EMU8086.INC' # Make_com # ORG 100H MOV Al, 1 CMP Al, 5 JB Label1 Print 'Al Is Not Below 5' JMP EXIT Label1: Print 'Al Is Below 5' EXIT: RET

CZSOPAunchanged JNB

label

SHORT JUMP if First Operand is Not Below Second Operand (As Set by Cmp Instruction). Unsigned. Algorithm:

IF cf = 0 THEN JUMP

Example: include 'EMU8086.INC' # Make_com # ORG 100H MOV Al, 7 CMP Al, 5 JNB Label1 Print 'Al <5.' JMP EXIT Label1: Print 'Al> = 5.' EXIT: RET

CzsoPaunchanged

转载请注明原文地址:https://www.9cbs.com/read-20397.html

New Post(0)