flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > BSR operator with negative constants |
Author |
|
Tomasz Grysztar 14 Dec 2022, 11:26
CandyMan wrote:
If you know your maximum size, just mask it out before the calculation: Code: A = bsr((-1) and 0FFFFFFFFFFFFFFFFh) In case of fasmg, you can use mask of any length (making bsr(-1) larger an larger). CandyMan wrote:
Code: macro IsPower V { if V=1 shl bsf(V) display 'IsPowerOf2' end if } |
|||
14 Dec 2022, 11:26 |
|
CandyMan 14 Dec 2022, 11:49
I understood. Thanks for the explanation.
|
|||
14 Dec 2022, 11:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.