BTC
Bit complement
تکمیل بیت
دستور BTC ، مکمل بیت می باشد .
Usage: BTC dest,src Modifies flags: CF
پرچم CF ( پرچم نقلی ) توسط دستور BTC اصلاح می شود .
The 'dest' bit indexed by the 'src' value is copied into the Carry Flag after being complimented (inverted).
بیت مقصد که توسط مقدار عملوند مبدا ، ایندکس شده است ، بعد از تکمیل شدن ، به درون پرچم نقلی کپی می شود (معکوس می شود . یعنی بیت ، وارونه می شود . بیت یعنی باینری دیجیت یعنی رقم دوتایی یعنی 0 یا 1 یعنی زبان ماشین ! )
Bit Test
تست بیت . آزمایش بیت
BT r/m16,reg16 ; o16 0F A3 /r [386]
BT r/m32,reg32 ; o32 0F A3 /r [386]
BT r/m16,imm8 ; o16 0F BA /4 ib [386]
BT r/m32,imm8 ; o32 0F BA /4 ib [386]
BTC r/m16,reg16 ; o16 0F BB /r [386]
BTC r/m32,reg32 ; o32 0F BB /r [386]
BTC r/m16,imm8 ; o16 0F BA /7 ib [386]
BTC r/m32,imm8 ; o32 0F BA /7 ib [386]
BTR r/m16,reg16 ; o16 0F B3 /r [386]
BTR r/m32,reg32 ; o32 0F B3 /r [386]
BTR r/m16,imm8 ; o16 0F BA /6 ib [386]
BTR r/m32,imm8 ; o32 0F BA /6 ib [386]
BTS r/m16,reg16 ; o16 0F AB /r [386]
BTS r/m32,reg32 ; o32 0F AB /r [386]
BTS r/m16,imm ; o16 0F BA /5 ib [386]
BTS r/m32,imm ; o32 0F BA /5 ib [386]
These instructions all test one bit of their first operand, whose index is given by the second operand, and store the value of that bit into the carry flag. Bit indices are from 0 (least significant) to 15 or 31 (most significant).
In addition to storing the original value of the bit into the carry flag, BTR also resets (clears) the bit in the operand itself. BTS sets the bit, and BTC complements the bit. BT does not modify its operands.
The destination can be a register or a memory location. The source can be a register or an immediate value.
If the destination operand is a register, the bit offset should be in the range 0-15 (for 16-bit operands) or 0-31 (for 32-bit operands). An immediate value outside these ranges will be taken modulo 16/32 by the processor.
If the destination operand is a memory location, then an immediate bit offset follows the same rules as for a register. If the bit offset is in a register, then it can be anything within the signed range of the register used (ie, for a 32-bit operand, it can be (-2^31) to (2^31 - 1)
مثال این دستور در اسمبلر RosAsm :
main:
mov eax 00_1111_0000 ; eax = 11110000b
mov ebx 7 ; ebx = 7d
btc eax ebx ; eax = 70h Note: change to carry flag