The Instruction operation "bitwise" can be used to work integer arithmetic using common mathematical expression handling (also known as 'infix' notation). The integers are expected to be in hexadecimal, and can be any length whatsoever. (Compare this with eg the arithmetic operation, where numbers are limited to about 7 bytes in size). So an entire file that has been hex-encoded may be treated as a single integer. This is mainly useful for cryptographic work.
The numbers in bitwise are treated as base 16 / hexadecimal both for inputs and outputs. They do not need to be prefixed with an 0x. Likewise, all calculations and numbers are treated as using integers (whole numbers) at all times.
The example below shows how the 'name' attribute is used for variable substitution. Results are in hexadecimal!
<instruction operation="bitwise">
<input value="(x+y)*3-2" />
<input name="x" value="4" />
<input name="y" value="3" />
</instruction>
13
Here is a list of operators that the arithemetic expression handler understands:
Here is a list of functions that the arithemetic expression handler understands, that take 2 parameters:
<instruction operation="bitwise" note="example using 2 parameter functions.">
<input value="and(max(pow(x,y),pow(y,x)),0x33)" />
<input name="x" value="4" />
<input name="y" value="3" />
</instruction>
11
Here is a list of functions that the arithemetic expression handler understands, that take 2 parameters, the second of which must not be too big a number (about 18 million trillion)!
<instruction operation="bitwise" note="example using 2 parameter functions.">
<input value="pow(shl(y,x),shr(z,x))" />
<input name="x" value="4" />
<input name="y" value="3" />
<input name="z" value="55" />
</instruction>
F300000
Here is a list of functions that the arithemetic expression handler understands, that take 1 parameter:
<instruction operation="bitwise" note="example using 1 parameter functions.">
<input value="not(abs(x))" />
<input name="x" value="-4" />
</instruction>
-5
Here is a list of functions that the bitwise expression handler understands, that take 3 parameters:
Note that any bits outside of the word length are not touched!
<instruction operation="bitwise" note="example using 3 parameter functions.">
<input value="rol(x,1,2)" />
<input name="x" value="5555555555555555555555555555555555555555" />
</instruction>
5555555555555555555555555555555555555556