@lp0_on_fire@social.linux.pizza
Post #2639706
2025-05-15 23:45 UTC
@gilesgoat@toot.wales @ela@infosec.exchange, it's not “i % 2”, as that would give an inverted result. It's either “~i & 1” or “1 & ~i”, depending on the output assembly code. Here it is, for 32-bit ARM:
MOV r1, #1
BIC r0, r1, r0
BX lr
(BIC is bit-clear, essentially AND NOT.)
Replies (1)
-
@gilesgoat@toot.wales 2025-05-16 05:58
@lp0_on_fire@social.linux.pizza @ela@infosec.exchange yes but if you want an isODD(x) that returns '1' if it's odd and '0' if not AND 01 will suffice, if you want the reverse you can do (NOT(X)) AND 01