flat assembler
Message board for the users of flat assembler.
Index
> Main > setting specified bit |
Author |
|
Tomasz Grysztar 23 Sep 2008, 14:22
Since you already know BT, read also about BTS/BTR/BTC.
|
|||
23 Sep 2008, 14:22 |
|
asmcoder 23 Sep 2008, 14:47
[content deleted]
Last edited by asmcoder on 14 Aug 2009, 14:56; edited 1 time in total |
|||
23 Sep 2008, 14:47 |
|
bitRAKE 23 Sep 2008, 15:25
All BT/BTC/BTS/BTR put the bit value in the carry flag - this is the "test". There is no single instruction to swap the carry flag and another bit. IIRC, there is a binary math trick to swap bits requiring two instructions, but no branch.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
23 Sep 2008, 15:25 |
|
edfed 23 Sep 2008, 16:57
no, that means complement.
com1=0 com0=1 and this subject is still aborded on the board many times. |
|||
23 Sep 2008, 16:57 |
|
baldr 09 Oct 2008, 19:14
asmcoder,
How about good old or [a],1? btx family is good for bit manipulation at an arbitrary bit index (they support register operand as bit index), for fixed bit index test, and, or & xor are somewhat better (proper coding ensures that you won't access word[0xFFFF] in 16-bit RM ), though barely equivalent (btx, you see). By the way, IA-32 (2003 A.D.) and Intel® 64 (April 2008, maybe 1st ) ASDMs in vol. 2 both insist that with btx you can index 16 bits using only 3 bits (32 bits' indices are correctly stated as 5 bits wide). |
|||
09 Oct 2008, 19:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.