Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Camdenmil on January 15, 2011, 07:25:04 pm
-
I'm probably missing something, but is there a way to get/set the value of a single bit in axe?
-
Documentation has this for reading bits:
EXPeBIT#
where e is euler's e. Returns BIT# of EXP, where the high bit is bit0 and the low bit is bit 7. Example, 255e0 would return 1.
Writing to bits, you basically have to "or" the bit over; so e^(bit#) or EXP -> EXP
As for resetting bits, I forget...
edit: here's a more optimizedish version by runer112; http://ourl.ca/7815/138430
-
or will set a bit
and will reset a bit
xor will toggle a bit
e^(#) [or/and/xor] EXP->EXP
where # is the bit to set 0-7 starting from the right hand side.
-
Actually, for and you need to use not(e^(#)) and EXP->EXP
-
How 'bout an Axiom, anyone?
-
Perhaps I'm behind in my Axe, but I wasn't aware that the Not( function was implemented in Axe.
-
Perhaps I'm behind in my Axe, but I wasn't aware that the Not( function was implemented in Axe.
It was added in Axe 0.4.7: "Bitwise complement command for 8 and 16 bit numbers"
-
I've been wanting that function for quite some time. Thanks for pointing it out :)