📄 8086_instruction_set.html
字号:
</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if first operand is Not Greater and Not Equal to second operand (as set by CMP instruction).Signed.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if SF <> OF then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 2 CMP AL, 3 JNGE label1 PRINT 'AL >= 3.' JMP exitlabel1: PRINT 'Al < 3.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JNL"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JNL</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if first operand is Not Less then second operand (as set by CMP instruction).Signed.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if SF = OF then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 2 CMP AL, -3 JNL label1 PRINT 'AL < -3.' JMP exitlabel1: PRINT 'Al >= -3.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JNLE"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JNLE</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if first operand is Not Less and Not Equal to second operand (as set by CMP instruction).Signed.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if (SF = OF) and (ZF = 0) then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 2 CMP AL, -3 JNLE label1 PRINT 'AL <= -3.' JMP exitlabel1: PRINT 'Al > -3.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JNO"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JNO</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if Not Overflow.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if OF = 0 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys">; -5 - 2 = -7 (inside -128..127); the result of SUB 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 exitlabel1: PRINT 'no overflow.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JNP"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JNP</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if No Parity (odd). Only 8 low bits of result are checked.Set by CMP, SUB, ADD, TEST, AND, OR, XOR instructions.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if PF = 0 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 00000111b ; AL = 7 OR AL, 0 ; just set flags. JNP label1 PRINT 'parity even.' JMP exitlabel1: PRINT 'parity odd.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JNS"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JNS</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if Not Signed (if positive).Set by CMP, SUB, ADD, TEST, AND, OR, XOR instructions.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if SF = 0 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 00000111b ; AL = 7 OR AL, 0 ; just set flags. JNS label1 PRINT 'signed.' JMP exitlabel1: PRINT 'not signed.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JNZ"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JNZ</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if Not Zero (not equal).Set by CMP, SUB, ADD, TEST, AND, OR, XOR instructions.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if ZF = 0 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 00000111b ; AL = 7 OR AL, 0 ; just set flags. JNZ label1 PRINT 'zero.' JMP exitlabel1: PRINT 'not zero.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JO"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JO</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if Overflow.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if OF = 1 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys">; -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 exitlabel1: PRINT 'overflow!'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JP"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JP</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if Parity (even). Only 8 low bits of result are checked.Set by CMP, SUB, ADD, TEST, AND, OR, XOR instructions.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if PF = 1 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 00000101b ; AL = 5 OR AL, 0 ; just set flags. JP label1 PRINT 'parity odd.' JMP exitlabel1: PRINT 'parity even.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JPE"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JPE</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if Parity Even. Only 8 low bits of result are checked.Set by CMP, SUB, ADD, TEST, AND, OR, XOR instructions.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if PF = 1 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 00000101b ; AL = 5 OR AL, 0 ; just set flags. JPE label1 PRINT 'parity odd.' JMP exitlabel1: PRINT 'parity even.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JPO"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JPO</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if Parity Odd. Only 8 low bits of result are checked.Set by CMP, SUB, ADD, TEST, AND, OR, XOR instructions.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if PF = 0 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 00000111b ; AL = 7 OR AL, 0 ; just set flags. JPO label1 PRINT 'parity even.' JMP exitlabel1: PRINT 'parity odd.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JS"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JS</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if Signed (if negative).Set by CMP, SUB, ADD, TEST, AND, OR, XOR instructions.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if SF = 1 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 10000000b ; AL = -128 OR AL, 0 ; just set flags. JS label1 PRINT 'not signed.' JMP exitlabel1: PRINT 'signed.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="JZ"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">JZ</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR>label</NOBR></FONT></TD><TD>Short Jump if Zero (equal).Set by CMP, SUB, ADD, TEST, AND, OR, XOR instructions.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> if ZF = 1 then jump</UL></FONT>Example:<PRE><FONT FACE="Fixedsys"> include 'emu8086.inc' #make_COM# ORG 100h MOV AL, 5 CMP AL, 5 JZ label1 PRINT 'AL is not equal to 5.' JMP exitlabel1: PRINT 'AL is equal to 5.'exit: RET</FONT></PRE><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="LAHF"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">LAHF</FONT></TD><TD>No operands</TD><TD>Load AH from 8 low bits of Flags register.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> AH = flags register<BR></UL><PRE><FONT FACE="Fixedsys">AH bit: 7 6 5 4 3 2 1 0 [SF] [ZF] [0] [AF] [0] [PF] [1] [CF]</FONT></PRE>bits 1, 3, 5 are reserved.</FONT><BR><BR><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="LDS"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">LDS</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR> REG, memory </NOBR></FONT></TD><TD>Load memory double word into word register and DS.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> <LI>REG = first word</LI> <LI>DS = second word</LI></UL></FONT><BR>Example:<PRE><FONT FACE="Fixedsys">#make_COM#ORG 100hLDS AX, mRETm DW 1234h DW 5678hEND</FONT></PRE>AX is set to 1234h, DS is set to 5678h.<BR><BR><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="LEA"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">LEA</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR> REG, memory </NOBR></FONT></TD><TD>Load Effective Address.<BR><BR>Algorithm:<BR><BR><FONT FACE="Fixedsys"><UL> <LI>REG = address of memory (offset)</LI></UL></FONT><BR>Generally this instruction is replaced by MOV when assembling when possible.<BR><BR>Example:<PRE><FONT FACE="Fixedsys">#make_COM#ORG 100hLEA AX, mRETm DW 1234hEND</FONT></PRE>AX is set to: 0104h.<BR>LEA instruction takes 3 bytes, RET takes 1 byte, we startat 100h, so the address of 'm' is 104h.<BR><BR><FONT FACE="Fixedsys"><TABLE BORDER=1 NOSHADE><TR> <TD>C</TD> <TD>Z</TD> <TD>S</TD> <TD>O</TD> <TD>P</TD> <TD>A</TD> </TR><TR> <TD COLSPAN=6>unchanged</TD> </TR></TABLE></FONT> <A NAME="LES"> </A></TD></TR><TR><TD><FONT FACE="Fixedsys">LES</FONT></TD><TD><FONT FACE="Fixedsys"> <NOBR> REG, memory </NOBR></FONT></TD><TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -