⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s16_03.htm

📁 Programmer s Reference Manual is an improtant book on Intel processor architecture and programming.
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>80386 Programmer's Reference Manual -- Section 16.3</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_02.htm">16.2  Mixing 32-Bit and 16-Bit Operations</A><BR><B>next:</B> <A HREF="s16_04.htm">16.4  Transferring Control Among Mixed Code Segments</A><P><HR><P><H1>16.3  Sharing Data Segments Among Mixed Code Segments</H1>Because the choice of operand size and address size is defined in codesegments and their descriptors, data segments can be shared freely amongboth USE16 and USE32 code segments. The only limitation is the one imposedby pointers with 16-bit offsets, which can only point to the first 64Kilobytes of a segment. When a data segment that contains more than 64Kilobytes is to be shared among USE32 and USE16 segments, the data that isto be accessed by the USE16 segments must be located within the first 64Kilobytes.<P>A stack that spans addresses less than 64K can be shared by both USE16 andUSE32 code segments. This class of stacks includes:<UL><LI> Stacks in expand-up segments with G=0 and B=0.<LI> Stacks in expand-down segments with G=0 and B=0.<LI> Stacks in expand-up segments with G=1 and B=0, in which the stack iscontained completely within the lower 64 Kilobytes. (Offsets greaterthan 64K can be used for data, other than the stack, that is notshared.)</UL>The B-bit of a stack segment cannot, in general, be used to change the sizeof stack used by a USE16 code segment. The size of stack pointer used by theprocessor for implicit stack references is controlled by the B-bit of thedata-segment descriptor for the stack. Implicit references are those causedby interrupts, exceptions, and instructions such as <A HREF="PUSH.htm">PUSH</A>, <A HREF="POP.htm">POP</A>, <A HREF="CALL.htm">CALL</A>, and<A HREF="RET.htm">RET</A>. One might be tempted, therefore, to try to increase beyond 64K thesize of the stack used by 16-bit code simply by supplying a larger stacksegment with the B-bit set. However, the B-bit does not control explicitstack references, such as accesses to parameters or local variables. A USE16code segment can utilize a "big" stack only if the code is modified so thatall explicit references to the stack are preceded by the address-sizeprefix, causing those references to use 32-bit addressing.<P>In big, expand-down segments (B=1, G=1, and E=1), all offsets are greaterthan 64K, therefore USE16 code cannot utilize such a stack segment unlessthe code segment is modified to employ 32-bit addressing . (Refer to <A HREF="c06.htm">Chapter 6</A>   for a review of the B , G, and E bits .)<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_02.htm">16.2  Mixing 32-Bit and 16-Bit Operations</A><BR><B>next:</B> <A HREF="s16_04.htm">16.4  Transferring Control Among Mixed Code Segments</A></BODY>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -