For this you had to get into mathematics until now, but now here is the new BIT\ command.
Code: Select all
BIT\[and|or|xor|not|set|clr|toggle|get]|p1|p2[>$$var]
The commands "and", "or", "xor" and "not" do exactly what their names say, with the given parameters "p1" and "p2".
p1 and p2 are considered as 32-bit values.
"set" - sets bit p2 in p1
"clr" - clear bit p2 in p1
"toggle" - changes bit p2 to p1 (from 0 to 1 or vice versa)
"get" - returns the value of bit p2 in p1.
The result is assigned to a program-internal variable, which you can access with the string "$v1$". If you specify the character ">" at the end of the data part and then a variable name ("$$ xyz"), the result is written directly into this variable.
Sample Code:
Code: Select all
BIT\and|4|1 ' $v1$ = 0
BIT\or|4|1 ' $v1$ = 5
BIT\set|4|1>$$xyz ' $$xyz = 5
BIT\get|4|1 ' $v1$ = 0
BIT\not|65535 ' $v1$ = -65536 (not(0000ffff) -> ffff0000)