📄 s16_02.htm
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>80386 Programmer's Reference Manual -- Section 16.2</TITLE></HEAD><BODY><B>up:</B> <A HREF="c16.htm">Chapter 16 -- Mixing 16-Bit and 32 Bit Code</A><BR><B>prev:</B> <A HREF="s16_01.htm">16.1 How the 80386 Implements 16-Bit and 32-Bit Features</A><BR><B>next:</B> <A HREF="s16_03.htm">16.3 Sharing Data Segments Among Mixed Code Segments</A><P><HR><P><H1>16.2 Mixing 32-Bit and 16-Bit Operations</H1>The 80386 has two instruction prefixes that allow mixing of 32-bit and16-bit operations within one segment:<UL><LI> The operand-size prefix (66H)<LI> The address-size prefix (67H)</UL><P>These prefixes reverse the default size selected by the D-bit. For example,the processor can interpret the word-move instruction <A HREF="MOV.htm">MOV</A> mem, reg in any offour ways:<UL><LI> In a USE32 segment:<OL><LI> Normally moves 32 bits from a 32-bit register to a 32-biteffective address in memory.<LI> If preceded by an operand-size prefix, moves 16 bits from a 16-bitregister to 32-bit effective address in memory.<LI> If preceded by an address-size prefix, moves 32 bits from a 32-bitregister to a16-bit effective address in memory.<LI> If preceded by both an address-size prefix and an operand-sizeprefix, moves 16 bits from a 16-bit register to a 16-bit effectiveaddress in memory.</OL><LI> In a USE16 segment:<OL><LI> Normally moves 16 bits from a 16-bit register to a 16-biteffective address in memory.<LI> If preceded by an operand-size prefix, moves 32 bits from a 32-bitregister to 16-bit effective address in memory.<LI> If preceded by an address-size prefix, moves 16 bits from a 16-bitregister to a32-bit effective address in memory.<LI> If preceded by both an address-size prefix and an operand-sizeprefix, moves 32 bits from a 32-bit register to a 32-bit effectiveaddress in memory.</OL></UL>These examples illustrate that any instruction can generate any combinationof operand size and address size regardless of whether the instruction is ina USE16 or USE32 segment. The choice of the USE16 or USE32 attribute for acode segment is based upon these criteria:<OL><LI> The need to address instructions or data in segments that are largerthan 64 Kilobytes.<LI> The predominant size of operands.<LI> The addressing modes desired. (Refer to <A HREF="c17.htm">Chapter 17</A> for an explanationof the additional addressing modes that are available when 32-bitaddressing is used.)</OL>Choosing a setting of the D-bit that is contrary to the predominant size ofoperands requires the generation of an excessive number of operand-sizeprefixes.<P><HR><P><B>up:</B> <A HREF="c16.htm">Chapter 16 -- Mixing 16-Bit and 32 Bit Code</A><BR><B>prev:</B> <A HREF="s16_01.htm">16.1 How the 80386 Implements 16-Bit and 32-Bit Features</A><BR><B>next:</B> <A HREF="s16_03.htm">16.3 Sharing Data Segments Among Mixed Code Segments</A></BODY>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -