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

📄 bts.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 -- Opcode BTS</TITLE></HEAD><BODY><B>up:</B> <A HREF="c17.htm">Chapter 17 -- 80386 Instruction Set</A><BR><B>prev:</B><A HREF="BTR.htm"> BTR Bit Test and Reset</A><BR><B>next:</B><A HREF="CALL.htm"> CALL Call Procedure</A><P><HR><P><H1>BTS -- Bit Test and Set</H1><PRE>Opcode        Instruction     Clocks  Description0F  AB        BTS r/m16,r16   6/13    Save bit in carry flag and set0F  AB        BTS r/m32,r32   6/13    Save bit in carry flag and set0F  BA /5 ib  BTS r/m16,imm8  6/8     Save bit in carry flag and set0F  BA /5 ib  BTS r/m32,imm8  6/8     Save bit in carry flag and set</PRE><H2>Operation</H2><PRE>CF := BIT[LeftSRC, RightSRC];BIT[LeftSRC, RightSRC] := 1;</PRE><H2>Description</H2>BTS saves the value of the bit indicated by the base (first operand) and thebit offset (second operand) into the carry flag and then stores 1 in thebit.<H2>Flags Affected</H2>CF as described above<H2>Protected Mode Exceptions</H2>#GP(0) if the result is in a nonwritable segment; #GP(0) for an illegalmemory operand effective address in the CS, DS, ES, FS, or GS segments;#SS(0) for an illegal address in the SS segment; #PF(fault-code) for a pagefault<H2>Real Address Mode Exceptions</H2>Interrupt 13 if any part of the operand would lie outside of the effectiveaddress space from 0 to 0FFFFH<H2>Virtual 8086 Mode Exceptions</H2>Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault<H2>Notes</H2>The index of the selected bit can be given by the immediate constant in theinstruction or by a value in a general register. Only an 8-bit immediatevalue is used in the instruction. This operand is taken modulo 32, so therange of immediate bit offsets is 0..31. This allows any bit within aregister to be selected. For memory bit strings, this immediate field givesonly the bit offset within a word or doubleword. Immediate bit offsetslarger than 31 are supported by using the immediate bit offset field incombination with the displacement field of the memory operand. Thelow-order 3 to 5 bits of the immediate bit offset are stored in theimmediate bit offset field, and the high order 27 to 29 bits are shifted andcombined with the byte displacement in the addressing mode.<P>When accessing a bit in memory, the processor may access four bytes startingfrom the memory address given by:<PRE>   Effective Address + (4 * (BitOffset DIV 32))</PRE>for a 32-bit operand size, or two bytes starting from the memory addressgiven by:<PRE>   Effective Address + (2 * (BitOffset DIV 16))</PRE>for a 16-bit operand size. It may do this even when only a single byte needsto be accessed in order to get at the given bit. Thus the programmer must becareful to avoid referencing areas of memory close to address space holes.In particular, avoid references to memory-mapped I/O registers. Instead, usethe <A HREF="MOV.htm">MOV</A>instructions to load from or store to these addresses, and use theregister form of these instructions to manipulate the data.<P><HR><P><B>up:</B> <A HREF="c17.htm">Chapter 17 -- 80386 Instruction Set</A><BR><B>prev:</B><A HREF="BTR.htm"> BTR Bit Test and Reset</A><BR><B>next:</B><A HREF="CALL.htm"> CALL Call Procedure</A></BODY>

⌨️ 快捷键说明

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