请问哪里有汇编语句的基本命令与使用下载.(50分)

  • 主题发起人 主题发起人 VincentXie
  • 开始时间 开始时间
V

VincentXie

Unregistered / Unconfirmed
GUEST, unregistred user!
请问哪里有汇编语句的基本命令与使用下载.<br>DELPHI内嵌编写
 
The built-in assembler supports the following opcodes.<br><br>LOCK REP REPE REPZ REPNE<br>REPNZ SEGES SEGCS SEGSS SEGDS<br>SEGFS SEGGS ADC,mLeft ADD,mLeft AND,mLeft<br>AAA,mAX AAS,mAX AAD,mAX AAM,mAX BOUND,<br>&nbsp; mNONE<br>BSF,mLeft BSR,mLeft BT BTC,mLeft BTR,mLeft<br>BTS,mLeft CALL,mNONE CMP CBW,mAX CWDE,mAX<br>CWD,<br>&nbsp; &lt;mAX,mDX&gt; CDQ,<br>&nbsp; &lt;mAX,mDX&gt; CLC CLD CLI<br>CMC CMPSB,<br>&nbsp; &lt;mSIDI&gt; CMPSW,<br>&nbsp; &lt;mSIDI&gt; CMPSD,<br>&nbsp; &lt;mSIDI&gt; DAA,mAX<br>DAS,mAX DEC,mLeft DIV,mLeft ENTER,<br>&nbsp; mNONE HLT<br>IDIV,mLeft IMUL,mLeft IN,mLeft INC,mLeft INSB,mDI<br>INSW,mDI INSD,mDI INT INTO IRET<br>IRETD JMP JO JNO JC<br>JB JNAE JNC JAE JNB<br>JE JZ JNE JNZ JBE<br>JNA JA JNBE JS JNS<br>JP JPE JNP JPO JL<br>JNGE JGE JNL JLE JNG<br>JG JNLE JCXZ JECXZ LAHF,mAX<br>LEA,mLeft LEAVE,<br>&nbsp; mNONE LDS,mSpecial LES,mSpecial LFS,mSpecial<br>LGS,mSpecial LSS,mSpecial LODSB,<br>&nbsp; &lt;mAX,mDI&gt; LODSW,<br>&nbsp; &lt;mAX,mDI&gt; LODSD,<br>&nbsp; &lt;mAX,mDI&gt;<br>LOOP,mCX LOOPE,mCX LOOPZ,mCX LOOPNE,mCX LOOPNZ,mCX<br>LOOPD,mCX LOOPDE,mCX LOOPDZ,mCX LOOPDNE,<br>&nbsp; mCX LOOPDNZ,<br>&nbsp; mCX<br>MOV,mLeft MOVSX,mLeft MOVZX,mLeft MOVSB,<br>&nbsp; &lt;mSIDI&gt; MOVSW,<br>&nbsp; &lt;mSIDI&gt;<br>MOVSD,<br>&nbsp; &lt;mSIDI&gt; MUL,mLeft NEG,mLeft NOP NOT,mLeft<br>OR,mLeft OUT OUTSB,mSI OUTSW,mSI OUTSD,mSI<br>POP,mLeft POPF POPA,mSpecial POPAD,<br>&nbsp; mSpecial POPFD,<br>&nbsp; mSpecial<br>PUSH PUSHF PUSHA PUSHAD PUSHFD<br>RET RETN RETF SUB,mLeft SBB,mLeft<br>RCL,mLeft RCR,mLeft ROL,mLeft ROR,mLeft SAL,mLeft<br>SHL,mLeft SAR,mLeft SHR,mLeft SHLD,mLeft SHRD,mLeft<br>SAHF SCASB,mDI SCASW,mDI SCASD,mDI STC<br>STD STI STOSB,mDI STOSW,mDI STOSD,mDI<br>TEST WAIT XCHG,&lt;mLeft,<br>&nbsp; mRight&gt; XLAT,mAX XOR,mLeft<br>SETA,mLeft SETAE,mLeft SETB,mLeft SETBE,mLeft SETC,mLeft<br>SETE,mLeft SETG,mLeft SETGE,mLeft SETL,mLeft SETLE,mLeft<br>SETNA,mLeft SETNAE,mLeft SETNB,mLeft SETNBE,mLeft SETNC,mLeft<br>SETNE,mLeft SETNG,mLeft SETNGE,mLeft SETNL,mLeft SETNLE,mLeft<br>SETNO,mLeft SETNP,mLeft SETNS,mLeft SETNZ,mLeft SETO,mLeft<br>SETP,mLeft SETPE,mLeft SETPO,mLeft SETS,mLeft SETZ,mLeft<br>ARPL LAR,mLeft CLTS LGDT SGDT<br>LIDT SIDT LLDT SLDT LMSW<br>SMSW LSL,mLeft LTR,mLeft STR,mLeft VERR<br>VERW BSWAP,mLeft XADD,mLeft CMPXCHG,<br>&nbsp; &lt;mLeft,mAX&gt; INVD<br>WBINVD INVLPG FLD,m87 FILD,m87 FST,m87<br>FSTP,m87 FIST,m87 FISTP,m87 FADD,m87 FADDP,m87<br>FIADD,m87 FSUB,m87 FSUBP,m87 FSUBR,m87 FSUBRP,m87<br>FISUB,m87 FISUBR,m87 FMUL,m87 FMULP,m87 FIMUL,m87<br>FDIV,m87 FDIVP,m87 FDIVR,m87 FDIVRP,m87 FIDIV,m87<br>FIDIVR,m87 FCOM,m87 FCOMP,m87 FCOMPP,m87 FICOM,m87<br>FICOMP,m87 F2XM1,m87 FABS,m87 FBLD,m87 FBSTP,m87<br>FCHS,m87 FDECSTP,m87 FFREE,m87 FINCSTP,m87 FLD1,m87<br>FLDCW,m87 FLDENV,m87 FLDL2E,m87 FLDL2T,m87 FLDLG2,m87<br>FLDLN2,m87 FLDPI,m87 FLDZ,m87 FNOP,m87 FPREM,m87<br>FPATAN,m87 FPTAN,m87 FRNDINT,m87 FRSTOR,m87 FSCALE,m87<br>FSETPM,m87 FSQRT,m87 FTST,m87 FWAIT,m87 FXAM,m87<br>FXCH,m87 FXTRACT,m87 FYL2X,m87 FYL2XP1,m87 FCLEX,m87<br>FNCLEX,m87 FDISI,m87 FNDISI,m87 FENI,m87 FNENI,m87<br>FINIT,m87 FNINIT,m87 FSAVE,m87 FNSAVE,m87 FSTCW,m87<br>FNSTCW,m87 FSTENV,m87 FNSTENV,m87 FSTSW,m87 FNSTSW,m87<br>FUCOM,m87 FUCOMP,m87 FUCOMPP,m87 FPREM1,m87 FCOS,m87<br>FSIN,m87 FSINCOS,m87 <br>For a complete description of each instruction, refer to your microprocessor documentation.<br><br>RET instruction sizing<br><br>The RET instruction opcode always generates a near return.<br><br>Automatic jump sizing<br><br>Unless otherwise directed, the built-in assembler optimizes jump instructions by automatically selecting the shortest, and therefore most efficient, form of a jump instruction. This automatic jump sizing applies to the unconditional jump instruction (JMP), and to all conditional jump instructions when the target is a label (not a procedure or function).<br>For an unconditional jump instruction (JMP), the built-in assembler generates a short jump (one-byte opcode followed by a one-byte displacement) if the distance to the target label is ?28 to 127 bytes. Otherwise it generates a near jump (one-byte opcode followed by a two-byte displacement).<br><br>For a conditional jump instruction, a short jump (one-byte opcode followed by a one-byte displacement) is generated if the distance to the target label is ?28 to 127 bytes. Otherwise, the built-in assembler generates a short jump with the inverse condition, which jumps over a near jump to the target label (five bytes in total). For example, the assembler statement<br><br>JC &nbsp; &nbsp; &nbsp;Stop<br><br>where Stop isn抰 within reach of a short jump, is converted to a machine code sequence that corresponds to this:<br><br>JNC &nbsp; &nbsp; &nbsp;Skip<br><br>JMP &nbsp; &nbsp; &nbsp;Stop<br>Skip:<br><br>Jumps to the entry points of procedures and functions are always near.<br><br>具体说明找本CPU指令系统的书看看吧。
 
对汇编的掌握不是看几条命令能行的,去买点资料吧
 
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8088 宏汇编速查手册<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ━━━━━━━━━━━━<br><br><br>一、数据传输指令<br>───────────────────────────────────────<br>&nbsp; &nbsp; 它们在存贮器和寄存器、寄存器和输入输出端口之间传送数据.<br>&nbsp; &nbsp; 1. 通用数据传送指令.<br>&nbsp; &nbsp; &nbsp; &nbsp; MOV &nbsp; &nbsp; 传送字或字节.<br>&nbsp; &nbsp; &nbsp; &nbsp; MOVSX &nbsp; 先符号扩展,再传送.<br>&nbsp; &nbsp; &nbsp; &nbsp; MOVZX &nbsp; 先零扩展,再传送.<br>&nbsp; &nbsp; &nbsp; &nbsp; PUSH &nbsp; &nbsp;把字压入堆栈.<br>&nbsp; &nbsp; &nbsp; &nbsp; POP &nbsp; &nbsp; 把字弹出堆栈.<br>&nbsp; &nbsp; &nbsp; &nbsp; PUSHA &nbsp; 把AX,CX,DX,BX,SP,BP,SI,DI依次压入堆栈.<br>&nbsp; &nbsp; &nbsp; &nbsp; POPA &nbsp; &nbsp;把DI,SI,BP,SP,BX,DX,CX,AX依次弹出堆栈.<br>&nbsp; &nbsp; &nbsp; &nbsp; PUSHAD &nbsp;把EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI依次压入堆栈.<br>&nbsp; &nbsp; &nbsp; &nbsp; POPAD &nbsp; 把EDI,ESI,EBP,ESP,EBX,EDX,ECX,EAX依次弹出堆栈.<br>&nbsp; &nbsp; &nbsp; &nbsp; BSWAP &nbsp; 交换32位寄存器里字节的顺序<br>&nbsp; &nbsp; &nbsp; &nbsp; XCHG &nbsp; &nbsp;交换字或字节.( 至少有一个操作数为寄存器,段寄存器不可作为操作数)<br>&nbsp; &nbsp; &nbsp; &nbsp; CMPXCHG 比较并交换操作数.( 第二个操作数必须为累加器AL/AX/EAX )<br>&nbsp; &nbsp; &nbsp; &nbsp; XADD &nbsp; &nbsp;先交换再累加.( 结果在第一个操作数里 )<br>&nbsp; &nbsp; &nbsp; &nbsp; XLAT &nbsp; &nbsp;字节查表转换.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ── BX 指向一张 256 字节的表的起点, AL 为表的索引值 (0-255,即<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0-FFH); 返回 AL 为查表结果. ( [BX+AL]-&gt;AL )<br>&nbsp; &nbsp; 2. 输入输出端口传送指令.<br>&nbsp; &nbsp; &nbsp; &nbsp; IN &nbsp; &nbsp; &nbsp;I/O端口输入. ( 语法: IN 累加器, {端口号│DX} )<br>&nbsp; &nbsp; &nbsp; &nbsp; OUT &nbsp; &nbsp; I/O端口输出. ( 语法: OUT {端口号│DX},累加器 )<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;输入输出端口由立即方式指定时, 其范围是 0-255; 由寄存器 DX 指定时,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;其范围是 0-65535.<br>&nbsp; &nbsp; 3. 目的地址传送指令.<br>&nbsp; &nbsp; &nbsp; &nbsp; LEA &nbsp; &nbsp; 装入有效地址.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;例: LEA DX,string &nbsp; ;把偏移地址存到DX.<br>&nbsp; &nbsp; &nbsp; &nbsp; LDS &nbsp; &nbsp; 传送目标指针,把指针内容装入DS.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;例: LDS SI,string &nbsp; ;把段地址:偏移地址存到DS:SI.<br>&nbsp; &nbsp; &nbsp; &nbsp; LES &nbsp; &nbsp; 传送目标指针,把指针内容装入ES.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;例: LES DI,string &nbsp; ;把段地址:偏移地址存到ES:DI.<br>&nbsp; &nbsp; &nbsp; &nbsp; LFS &nbsp; &nbsp; 传送目标指针,把指针内容装入FS.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;例: LFS DI,string &nbsp; ;把段地址:偏移地址存到FS:DI.<br>&nbsp; &nbsp; &nbsp; &nbsp; LGS &nbsp; &nbsp; 传送目标指针,把指针内容装入GS.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;例: LGS DI,string &nbsp; ;把段地址:偏移地址存到GS:DI.<br>&nbsp; &nbsp; &nbsp; &nbsp; LSS &nbsp; &nbsp; 传送目标指针,把指针内容装入SS.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;例: LSS DI,string &nbsp; ;把段地址:偏移地址存到SS:DI.<br>&nbsp; &nbsp; 4. 标志传送指令.<br>&nbsp; &nbsp; &nbsp; &nbsp; LAHF &nbsp; &nbsp;标志寄存器传送,把标志装入AH.<br>&nbsp; &nbsp; &nbsp; &nbsp; SAHF &nbsp; &nbsp;标志寄存器传送,把AH内容装入标志寄存器.<br>&nbsp; &nbsp; &nbsp; &nbsp; PUSHF &nbsp; 标志入栈.<br>&nbsp; &nbsp; &nbsp; &nbsp; POPF &nbsp; &nbsp;标志出栈.<br>&nbsp; &nbsp; &nbsp; &nbsp; PUSHD &nbsp; 32位标志入栈.<br>&nbsp; &nbsp; &nbsp; &nbsp; POPD &nbsp; &nbsp;32位标志出栈.<br><br>二、算术运算指令<br>───────────────────────────────────────<br>&nbsp; &nbsp; &nbsp; &nbsp; ADD &nbsp; &nbsp; 加法.<br>&nbsp; &nbsp; &nbsp; &nbsp; ADC &nbsp; &nbsp; 带进位加法.<br>&nbsp; &nbsp; &nbsp; &nbsp; INC &nbsp; &nbsp; 加 1.<br>&nbsp; &nbsp; &nbsp; &nbsp; AAA &nbsp; &nbsp; 加法的ASCII码调整.<br>&nbsp; &nbsp; &nbsp; &nbsp; DAA &nbsp; &nbsp; 加法的十进制调整.<br>&nbsp; &nbsp; &nbsp; &nbsp; SUB &nbsp; &nbsp; 减法.<br>&nbsp; &nbsp; &nbsp; &nbsp; SBB &nbsp; &nbsp; 带借位减法.<br>&nbsp; &nbsp; &nbsp; &nbsp; DEC &nbsp; &nbsp; 减 1.<br>&nbsp; &nbsp; &nbsp; &nbsp; NEC &nbsp; &nbsp; 求反(以 0 减之).<br>&nbsp; &nbsp; &nbsp; &nbsp; CMP &nbsp; &nbsp; 比较.(两操作数作减法,仅修改标志位,不回送结果).<br>&nbsp; &nbsp; &nbsp; &nbsp; AAS &nbsp; &nbsp; 减法的ASCII码调整.<br>&nbsp; &nbsp; &nbsp; &nbsp; DAS &nbsp; &nbsp; 减法的十进制调整.<br>&nbsp; &nbsp; &nbsp; &nbsp; MUL &nbsp; &nbsp; 无符号乘法.<br>&nbsp; &nbsp; &nbsp; &nbsp; IMUL &nbsp; &nbsp;整数乘法.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 以上两条,结果回送AH和AL(字节运算),或DX和AX(字运算),<br>&nbsp; &nbsp; &nbsp; &nbsp; AAM &nbsp; &nbsp; 乘法的ASCII码调整.<br>&nbsp; &nbsp; &nbsp; &nbsp; DIV &nbsp; &nbsp; 无符号除法.<br>&nbsp; &nbsp; &nbsp; &nbsp; IDIV &nbsp; &nbsp;整数除法.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 以上两条,结果回送:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 商回送AL,余数回送AH, (字节运算);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 或 &nbsp;商回送AX,余数回送DX, (字运算).<br>&nbsp; &nbsp; &nbsp; &nbsp; AAD &nbsp; &nbsp; 除法的ASCII码调整.<br>&nbsp; &nbsp; &nbsp; &nbsp; CBW &nbsp; &nbsp; 字节转换为字. (把AL中字节的符号扩展到AH中去)<br>&nbsp; &nbsp; &nbsp; &nbsp; CWD &nbsp; &nbsp; 字转换为双字. (把AX中的字的符号扩展到DX中去)<br>&nbsp; &nbsp; &nbsp; &nbsp; CWDE &nbsp; &nbsp;字转换为双字. (把AX中的字符号扩展到EAX中去)<br>&nbsp; &nbsp; &nbsp; &nbsp; CDQ &nbsp; &nbsp; 双字扩展. &nbsp; &nbsp; (把EAX中的字的符号扩展到EDX中去)<br><br>三、逻辑运算指令<br>───────────────────────────────────────<br>&nbsp; &nbsp; &nbsp; &nbsp; AND &nbsp; &nbsp; 与运算.<br>&nbsp; &nbsp; &nbsp; &nbsp; OR &nbsp; &nbsp; &nbsp;或运算.<br>&nbsp; &nbsp; &nbsp; &nbsp; XOR &nbsp; &nbsp; 异或运算.<br>&nbsp; &nbsp; &nbsp; &nbsp; NOT &nbsp; &nbsp; 取反.<br>&nbsp; &nbsp; &nbsp; &nbsp; TEST &nbsp; &nbsp;测试.(两操作数作与运算,仅修改标志位,不回送结果).<br>&nbsp; &nbsp; &nbsp; &nbsp; SHL &nbsp; &nbsp; 逻辑左移.<br>&nbsp; &nbsp; &nbsp; &nbsp; SAL &nbsp; &nbsp; 算术左移.(=SHL)<br>&nbsp; &nbsp; &nbsp; &nbsp; SHR &nbsp; &nbsp; 逻辑右移.<br>&nbsp; &nbsp; &nbsp; &nbsp; SAR &nbsp; &nbsp; 算术右移.(=SHR)<br>&nbsp; &nbsp; &nbsp; &nbsp; ROL &nbsp; &nbsp; 循环左移.<br>&nbsp; &nbsp; &nbsp; &nbsp; ROR &nbsp; &nbsp; 循环右移.<br>&nbsp; &nbsp; &nbsp; &nbsp; RCL &nbsp; &nbsp; 通过进位的循环左移.<br>&nbsp; &nbsp; &nbsp; &nbsp; RCR &nbsp; &nbsp; 通过进位的循环右移.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 以上八种移位指令,其移位次数可达255次.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 移位一次时, 可直接用操作码. &nbsp;如 SHL AX,1.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 移位&gt;1次时, 则由寄存器CL给出移位次数.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 如 &nbsp;MOV CL,04<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SHL AX,CL<br><br>四、串指令<br>───────────────────────────────────────<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DS:SI &nbsp; 源串段寄存器 &nbsp;:源串变址.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ES:DI &nbsp; 目标串段寄存器:目标串变址.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CX &nbsp; &nbsp; &nbsp;重复次数计数器.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AL/AX &nbsp; 扫描值.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; D标志 &nbsp; 0表示重复操作中SI和DI应自动增量; 1表示应自动减量.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Z标志 &nbsp; 用来控制扫描或比较操作的结束.<br>&nbsp; &nbsp; &nbsp; &nbsp; MOVS &nbsp; &nbsp;串传送.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( MOVSB &nbsp; 传送字符. &nbsp; &nbsp;MOVSW &nbsp; 传送字. &nbsp; &nbsp;MOVSD &nbsp; 传送双字. )<br>&nbsp; &nbsp; &nbsp; &nbsp; CMPS &nbsp; &nbsp;串比较.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( CMPSB &nbsp; 比较字符. &nbsp; &nbsp;CMPSW &nbsp; 比较字. )<br>&nbsp; &nbsp; &nbsp; &nbsp; SCAS &nbsp; &nbsp;串扫描.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 把AL或AX的内容与目标串作比较,比较结果反映在标志位.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( SCASB &nbsp; 传送字符. &nbsp; &nbsp;SCASW &nbsp; 传送字. )<br>&nbsp; &nbsp; &nbsp; &nbsp; LODS &nbsp; &nbsp;装入串.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 把源串中的元素(字或字节)逐一装入AL或AX中.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( LODSB &nbsp; 传送字符. &nbsp; &nbsp;LODSW &nbsp; 传送字. &nbsp; &nbsp;LODSD &nbsp; 传送双字. )<br>&nbsp; &nbsp; &nbsp; &nbsp; STOS &nbsp; &nbsp;保存串.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 是LODS的逆过程.<br>&nbsp; &nbsp; &nbsp; &nbsp; REP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;当CX/ECX&lt;&gt;0时重复.<br>&nbsp; &nbsp; &nbsp; &nbsp; REPE/REPZ &nbsp; &nbsp; &nbsp;当ZF=1或比较结果相等,且CX/ECX&lt;&gt;0时重复.<br>&nbsp; &nbsp; &nbsp; &nbsp; REPNE/REPNZ &nbsp; &nbsp;当ZF=0或比较结果不相等,且CX/ECX&lt;&gt;0时重复.<br>&nbsp; &nbsp; &nbsp; &nbsp; REPC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 当CF=1且CX/ECX&lt;&gt;0时重复.<br>&nbsp; &nbsp; &nbsp; &nbsp; REPNC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;当CF=0且CX/ECX&lt;&gt;0时重复.<br><br>五、程序转移指令<br>───────────────────────────────────────<br>&nbsp; &nbsp; 1&gt;无条件转移指令 (长转移)<br>&nbsp; &nbsp; &nbsp; &nbsp; JMP &nbsp; &nbsp; 无条件转移指令<br>&nbsp; &nbsp; &nbsp; &nbsp; CALL &nbsp; &nbsp;过程调用<br>&nbsp; &nbsp; &nbsp; &nbsp; RET/RETF过程返回.<br>&nbsp; &nbsp; 2&gt;条件转移指令 (短转移,-128到+127的距离内)<br>&nbsp; &nbsp; &nbsp; &nbsp; ( 当且仅当(SF XOR OF)=1时,OP1&lt;OP2 )<br>&nbsp; &nbsp; &nbsp; &nbsp; JA/JNBE 不小于或不等于时转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JAE/JNB 大于或等于转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JB/JNAE 小于转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JBE/JNA 小于或等于转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 以上四条,测试无符号整数运算的结果(标志C和Z).<br>&nbsp; &nbsp; &nbsp; &nbsp; JG/JNLE 大于转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JGE/JNL 大于或等于转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JL/JNGE 小于转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JLE/JNG 小于或等于转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 以上四条,测试带符号整数运算的结果(标志S,O和Z).<br>&nbsp; &nbsp; &nbsp; &nbsp; JE/JZ &nbsp; 等于转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JNE/JNZ 不等于时转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JC &nbsp; &nbsp; &nbsp;有进位时转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JNC &nbsp; &nbsp; 无进位时转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JNO &nbsp; &nbsp; 不溢出时转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JNP/JPO 奇偶性为奇数时转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JNS &nbsp; &nbsp; 符号位为 "0" 时转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JO &nbsp; &nbsp; &nbsp;溢出转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JP/JPE &nbsp;奇偶性为偶数时转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JS &nbsp; &nbsp; &nbsp;符号位为 "1" 时转移.<br>&nbsp; &nbsp; 3&gt;循环控制指令(短转移)<br>&nbsp; &nbsp; &nbsp; &nbsp; LOOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CX不为零时循环.<br>&nbsp; &nbsp; &nbsp; &nbsp; LOOPE/LOOPZ &nbsp; &nbsp; CX不为零且标志Z=1时循环.<br>&nbsp; &nbsp; &nbsp; &nbsp; LOOPNE/LOOPNZ &nbsp; CX不为零且标志Z=0时循环.<br>&nbsp; &nbsp; &nbsp; &nbsp; JCXZ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CX为零时转移.<br>&nbsp; &nbsp; &nbsp; &nbsp; JECXZ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ECX为零时转移.<br>&nbsp; &nbsp; 4&gt;中断指令<br>&nbsp; &nbsp; &nbsp; &nbsp; INT &nbsp; &nbsp; 中断指令<br>&nbsp; &nbsp; &nbsp; &nbsp; INTO &nbsp; &nbsp;溢出中断<br>&nbsp; &nbsp; &nbsp; &nbsp; IRET &nbsp; &nbsp;中断返回<br>&nbsp; &nbsp; 5&gt;处理器控制指令<br>&nbsp; &nbsp; &nbsp; &nbsp; HLT &nbsp; &nbsp; 处理器暂停, 直到出现中断或复位信号才继续.<br>&nbsp; &nbsp; &nbsp; &nbsp; WAIT &nbsp; &nbsp;当芯片引线TEST为高电平时使CPU进入等待状态.<br>&nbsp; &nbsp; &nbsp; &nbsp; ESC &nbsp; &nbsp; 转换到外处理器.<br>&nbsp; &nbsp; &nbsp; &nbsp; LOCK &nbsp; &nbsp;封锁总线.<br>&nbsp; &nbsp; &nbsp; &nbsp; NOP &nbsp; &nbsp; 空操作.<br>&nbsp; &nbsp; &nbsp; &nbsp; STC &nbsp; &nbsp; 置进位标志位.<br>&nbsp; &nbsp; &nbsp; &nbsp; CLC &nbsp; &nbsp; 清进位标志位.<br>&nbsp; &nbsp; &nbsp; &nbsp; CMC &nbsp; &nbsp; 进位标志取反.<br>&nbsp; &nbsp; &nbsp; &nbsp; STD &nbsp; &nbsp; 置方向标志位.<br>&nbsp; &nbsp; &nbsp; &nbsp; CLD &nbsp; &nbsp; 清方向标志位.<br>&nbsp; &nbsp; &nbsp; &nbsp; STI &nbsp; &nbsp; 置中断允许位.<br>&nbsp; &nbsp; &nbsp; &nbsp; CLI &nbsp; &nbsp; 清中断允许位.<br><br>六、伪指令<br>───────────────────────────────────────<br>&nbsp; &nbsp; &nbsp; &nbsp; DB &nbsp; &nbsp; &nbsp;定义字节.<br>&nbsp; &nbsp; &nbsp; &nbsp; DW &nbsp; &nbsp; &nbsp;定义字(2字节).<br>&nbsp; &nbsp; &nbsp; &nbsp; PROC &nbsp; &nbsp;定义过程.<br>&nbsp; &nbsp; &nbsp; &nbsp; ENDP &nbsp; &nbsp;过程结束.<br>&nbsp; &nbsp; &nbsp; &nbsp; SEGMENT 定义段.<br>&nbsp; &nbsp; &nbsp; &nbsp; ASSUME &nbsp;建立段寄存器寻址.<br>&nbsp; &nbsp; &nbsp; &nbsp; ENDS &nbsp; &nbsp;段结束.<br>&nbsp; &nbsp; &nbsp; &nbsp; END &nbsp; &nbsp; 程序结束.<br><br>七. 系统和BIOS,DOS占用的中断向量<br>───────────────────────────────────────<br>&nbsp; &nbsp; .中断 0: 除数为0错 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 19: 引导装入程序<br>&nbsp; &nbsp; .中断 1: 单步中断 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 1A: 日时调用<br>&nbsp; &nbsp; .中断 2: 不可屏蔽中断 NMI &nbsp; &nbsp; &nbsp; .中断 1B: 键盘阻断时得到控制权<br>&nbsp; &nbsp; .中断 3: 断电中断 (CCH) &nbsp; &nbsp; &nbsp; &nbsp; .中断 1C: 时钟中断时得到控制权<br>&nbsp; &nbsp; .中断 4: 溢出中断 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 1D: 指向CRT初始参数表<br>&nbsp; &nbsp; .中断 5: 屏幕打印中断 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 1E: 指向盒带参数表<br>&nbsp; &nbsp; .中断 6-7: 保留 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 1F: 1KB图形模式CRT用第128至256号字符<br>&nbsp; &nbsp; .中断 8: 计时器中断(18.2/秒) &nbsp; &nbsp;.中断 20: 结束DOS程序<br>&nbsp; &nbsp; .中断 9: 键盘中断 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 21: DOS功能调用<br>&nbsp; &nbsp; .中断 A-D: 保留 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 22: 结束地址 (建议用EXEC功能调用)<br>&nbsp; &nbsp; .中断 E: 软盘机中断 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 23: DOS Ctrl-Break退出地址<br>&nbsp; &nbsp; .中断 F: 保留 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 24: DOS 致命错向量<br>&nbsp; &nbsp; .中断 10: 屏幕I/O调用 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 25: DOS 绝对磁盘读<br>&nbsp; &nbsp; .中断 11: 设备检查调用 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.中断 26: DOS 绝对磁盘写<br>&nbsp; &nbsp; .中断 12: 存贮器检查调用 &nbsp; &nbsp; &nbsp; &nbsp;.中断 27: 结束程序并贮留(建议用31H功能调用)<br>&nbsp; &nbsp; .中断 13: 软盘机I/O调用 &nbsp; &nbsp; &nbsp; &nbsp; .中断 28-3F: DOS 保留<br>&nbsp; &nbsp; .中断 14: RS-232 I/O 调用 &nbsp; &nbsp; &nbsp; .中断 40-7F: 未用<br>&nbsp; &nbsp; .中断 15: 盒带机I/O调用 &nbsp; &nbsp; &nbsp; &nbsp; .中断 80-85: BASIC保留<br>&nbsp; &nbsp; .中断 16: 键盘I/O调用 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .中断 86-F0: BASIC解释程序用<br>&nbsp; &nbsp; .中断 17: 打印机I/O调用 &nbsp; &nbsp; &nbsp; &nbsp; .中断 F1-FF: 未用<br>&nbsp; &nbsp; .中断 18: ROM-BASIC入口<br><br>八. IBM PC 的中断 INT 10:<br>───────────────────────────────────────<br>&nbsp; &nbsp;.00H 屏幕方式设置.<br>&nbsp; &nbsp; &nbsp; 入口: AH=0, AL=显示方式代码.(0-6)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0: 40x25 黑白 &nbsp;1: 40x25 彩色 &nbsp;2: 80x25 黑白 &nbsp;3: 80x25 彩色文本方式<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4: 320x200 彩色 &nbsp;5: 320x200 黑白 &nbsp;6: 640x200 黑白图形方式<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7: 80x25 单色字符 (单色显示器)<br>&nbsp; &nbsp;.01H 设光标大小<br>&nbsp; &nbsp; &nbsp; 入口: AH=1, CH=光标起始行号(00-0C), CL=光标结束行号(00-0C), 且CH&lt;CL.<br>&nbsp; &nbsp;.02H 光标定位<br>&nbsp; &nbsp; &nbsp; 入口: AH=2, BH=页号, DH:DL=起始行:列.<br>&nbsp; &nbsp;.03H 读光标位置<br>&nbsp; &nbsp; &nbsp; 入口: AH=3, BH=页号. 返回: DH:DL=起始行:列.<br>&nbsp; &nbsp;.06H 窗口上卷<br>&nbsp; &nbsp; &nbsp; 入口: AH=6, AL=窗口上卷行数(AL=0 卷动整个窗口);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CH:CL -DH:DL &nbsp;窗口坐标<br>&nbsp; &nbsp;.07H 窗口下卷<br>&nbsp; &nbsp; &nbsp; 入口: AH=7, AL=窗口下卷行数<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CH:CL -DH:DL &nbsp;窗口坐标<br>&nbsp; &nbsp;.08H 读当前光标处字符和属性<br>&nbsp; &nbsp; &nbsp; 入口: AH=8, BH=页号. 返回: AH:AL=字符的颜色:字符的ASCII码<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 显示字符的颜色定义如下:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; 2 &nbsp; 3 &nbsp; 4 &nbsp; 5 &nbsp; 6 &nbsp; 7 &nbsp; 8<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;┌─┬─┬─┬─┬─┬─┬─┬─┐<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│BL│R│G│B│I│R│G│B│<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└─┴─┴─┴─┴─┴─┴─┴─┘ &nbsp;B-兰 G-绿 R-红<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;闪 &nbsp;└───┘ &nbsp;加 &nbsp;└───┘<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;烁 &nbsp; 字符底色 &nbsp; 亮 &nbsp;字符显示色<br>&nbsp; &nbsp;.09H 在当前光标处写字符和属性(光标不下移).<br>&nbsp; &nbsp; &nbsp; 入口: AH=9, BH=页号, BL:AL=字符的颜色:字符的ASCII码, CX=重复次数.<br>&nbsp; &nbsp;.0AH 在当前光标处写字符(原有属性)<br>&nbsp; &nbsp; &nbsp; 入口: AH=0A, BH=页号, AL=字符的ASCII码, CX=重复次数.<br>&nbsp; &nbsp;.0BH 色彩设置<br>&nbsp; &nbsp; &nbsp; 入口: AH=0B, BL=0 &nbsp;设背景色, BH=0-15<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BL=1 &nbsp;设调色码, BH=0-1<br>&nbsp; &nbsp;.0CH 写图形点<br>&nbsp; &nbsp; &nbsp; 入口: AH=0C, CX:DX=列号:行号, AL=颜色.<br>&nbsp; &nbsp;.0DH 读图形点<br>&nbsp; &nbsp; &nbsp; 入口: AH=0D, CX:DX=列号:行号. 返回: AL=颜色,<br>&nbsp; &nbsp;.0EH 在当前页、当前光标处写字符<br>&nbsp; &nbsp; &nbsp; 入口: AH=0E, AL=字符的ASCII码, BL=前景色.<br>&nbsp; &nbsp;.0FH 显示器状态<br>&nbsp; &nbsp; &nbsp; 入口: AH=0F. 返回: AL=当前显示器方式, AH=屏幕列数, BH=当前页号<br><br>九. IBM PC 的键盘中断 INT 16:<br>───────────────────────────────────────<br>&nbsp; &nbsp;.00H 读一个键盘键入字符.<br>&nbsp; &nbsp; &nbsp; 入口: AH=0. &nbsp;返回: AL=字符的ASCII码, AH=扫描码.<br>&nbsp; &nbsp;.01H 确认键盘是否键入字符.<br>&nbsp; &nbsp; &nbsp; 入口: AH=1. &nbsp;返回: ZF=1 (Z) 未键入字符;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ZF=0 (NZ)键入字符, AL=字符的ASCII码, AH=扫描码.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;键入字符同时留在键盘缓冲区.<br>&nbsp; &nbsp;.02H 读当前移位键状况.<br>&nbsp; &nbsp; &nbsp; 入口: AH=2.<br>&nbsp; &nbsp; &nbsp; 返回: AL=状态.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7 &nbsp; 6 &nbsp; 5 &nbsp; 4 &nbsp; 3 &nbsp; 2 &nbsp; 1 &nbsp; 0<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;┌─┬─┬─┬─┬─┬─┬─┬─┐<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AL: &nbsp; &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└─┴─┴─┴─┴─┴─┴─┴─┘<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;└─右Shift<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;└─左Shift<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;└─Ctrl<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;└─Alt<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp;│ &nbsp;│ &nbsp;└─Scroll Lock<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp;│ &nbsp;└─Num Lock<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp;└─Capa Lock<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└─Ins<br><br>十. ROM 中断 INT 13:<br>───────────────────────────────────────<br>&nbsp; &nbsp; &nbsp;A.软盘机I/O调用(360K)<br>&nbsp; &nbsp; &nbsp; &nbsp;.00H 复位盘系统<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 入口: AH =0<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 返回: AH =磁盘状态<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0-坏命令, 1-盘上地址找不到, 3-写保护, 4-扇区找不到, ...<br>&nbsp; &nbsp; &nbsp; &nbsp;.01H 读磁盘状态<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 入口: AH =1<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 返回: AH =磁盘状态<br>&nbsp; &nbsp; &nbsp; &nbsp;.02H 磁盘读<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 入口: AH =2, DL =驱动器号(0-3), 0=A, 1=B, 2=C<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DH =头号(0或1), CH =道号(0-39H), CL =起始扇区号(1-9)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AL =欲读扇区数(1-9), ES:BX =内存缓冲区首址.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 返回: AL =实际读入扇区数,AH =磁盘状态; 进位标志CF =0,出错; =1,成功.<br>&nbsp; &nbsp; &nbsp; &nbsp;.03H 磁盘写<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 入口: AH =3, DL =驱动器号(0-3), 0=A, 1=B, 2=C<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DH =头号(0或1), CH =道号(0-39H), CL =起始扇区号(1-9)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AL =欲写扇区数(1-9), ES:BX =内存缓冲区首址.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 返回: AL =实际写入扇区数,AH =磁盘状态; 进位标志CF =0,出错; =1,成功.<br>&nbsp; &nbsp; &nbsp;B.硬盘机I/O调用<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 入口: AH =0-3, DL =驱动器号(硬盘80H,81H), 80=C, 81=D<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DH =头号(硬盘0-15), CH =道号(0-1023), CL =起始扇区号(1-17)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AL =欲读写扇区数, ES:BX =内存缓冲区首址.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 返回: AL =实际读入扇区数,AH =磁盘状态; 进位标志CF =0,出错; =1,成功.<br><br>十一. 绝对磁盘读写 (中断25,中断26)<br>───────────────────────────────────────<br>&nbsp; &nbsp; &nbsp;A. INT 25 绝对磁盘读<br>&nbsp; &nbsp; &nbsp;B. INT 26 绝对磁盘写<br>&nbsp; &nbsp; &nbsp; &nbsp; 入口: AL =驱动器号(0-2), 0=A, 1=B, 2=C<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DX =起始扇区的逻辑扇区号<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CX =欲读写扇区数(1-80H),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DS:BX =内存缓冲区首址.<br><br>十二. IBM PC 功能调用 (中断 INT 21)<br>───────────────────────────────────────<br>&nbsp; &nbsp;.00H 程序结束.<br>&nbsp; &nbsp;.01H 键盘输入一个字符.(回显)<br>&nbsp; &nbsp; &nbsp; &nbsp; 入口: AH=01. &nbsp; &nbsp; &nbsp;返回: DL=输入字符.<br>&nbsp; &nbsp; &nbsp; &nbsp; 对扩展键, 要求两次功能调用.<br>&nbsp; &nbsp;.02H 显示一个字符.<br>&nbsp; &nbsp; &nbsp; &nbsp; 入口: AH=02, DL=字符.(07响铃,08退格,0D回车,0A换行)<br>&nbsp; &nbsp;.05H 打印一个字符.<br>&nbsp; &nbsp; &nbsp; &nbsp; 入口: AH=05, DL=字符.(0D回车,0A换行)<br>&nbsp; &nbsp;.08H 键盘输入一个字符.(不回显)<br>&nbsp; &nbsp; &nbsp; &nbsp; 入口: AH=08. &nbsp; &nbsp; &nbsp;返回: DL=输入字符.<br>&nbsp; &nbsp; &nbsp; &nbsp; 对扩展键, 要求两次功能调用.<br>&nbsp; &nbsp;.09H 显示一串字符.<br>&nbsp; &nbsp; &nbsp; &nbsp; 入口: AH=09, DS:DX=字符串首址.(字符串必须以字符'$'结尾.)<br>&nbsp; &nbsp;.0AH 键盘输入一串字符.<br>&nbsp; &nbsp; &nbsp; &nbsp; 入口: AH=0A, DS:DX=字符串首址. 字节DS:[DX]=缓冲区长(最多容纳字符数)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (输入字符串必须以回车结尾.)<br>&nbsp; &nbsp; &nbsp; &nbsp; 返回: 字符串首址在DS:DX+2,字符数=DS:[DX+1].<br>&nbsp; &nbsp;.0CH 清键盘缓冲区,并调用键盘功能(.01H,06H,07H,08H或0AH).<br>&nbsp; &nbsp; &nbsp; &nbsp; 入口: AH=0C, AL=调用键盘功能号(.01H,06H,07H,08H或0AH).<br>&nbsp; &nbsp;.30H 取得DOS版本号.<br>&nbsp; &nbsp; &nbsp; &nbsp; 返回: AL-主版本号, AH-次版本号<br>&nbsp; &nbsp;.42H 移动文件读写指针<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AL=0 &nbsp; &nbsp;指针从文件开始移动CX:DX个字节<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AL=1 &nbsp; &nbsp;指针从当前位置开始移动CX:DX个字节<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AL=2 &nbsp; &nbsp;指针从文件尾向前移动CX:DX个字节<br>&nbsp; &nbsp;.43H 改变文件属性<br>&nbsp; &nbsp;.4CH 结束DOS程序,并保留代码可用于批处理中.<br><br>十三.<br>───────────────────────────────────────<br>&nbsp; &nbsp; 1.控制扬声器发声<br>&nbsp; &nbsp; &nbsp; &nbsp; 把61H端口的第零位置0,第一位置1<br><br>&nbsp; &nbsp; 2.控制扬声器发指定频率声音<br>&nbsp; &nbsp; &nbsp; &nbsp; 0B6H--&gt;PORT 43H<br>&nbsp; &nbsp; &nbsp; &nbsp; 脉冲频率--&gt;PORT 42H<br>&nbsp; &nbsp; &nbsp; &nbsp; PORT 61H的低两位置1<br>&nbsp; &nbsp; &nbsp; &nbsp; 延时<br>&nbsp; &nbsp; &nbsp; &nbsp; 恢复PORT 61H的低两位<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ━ 完 ━<br>
 
接受答案了.
 
后退
顶部