- Swap the contents of two registers.
XOR R0, R1
XOR R1, R0
XOR R0, R1
Remember "1" in result means differences, while "0" means same. However when the number apears in operation of XOR, "1" means reverse and "0" means keep. - To judge if two numbers are equal, we can also use XOR.
XOR R0, R1
If the result is 0, then R0 and R1 are equal. Otherwise they are not. - Struct type allows the specification of elements of a structure into a fixed number of bits.
struct fivebits
{
unsigned int flag : 1; // act as switch, on (1) or off (0)
signed int num : 4; // number ranges from -8...7
: 3; // empty 3 bits used to align to 8bits, this is necessary for manipulation
}
Wednesday, 1 February 2012
Programming tricks
Subscribe to:
Post Comments (Atom)
Difference between "docker stop" and "docker kill"
To stop a running container, you can use either "docker stop" or "docker kill" command to do so. Although it seems doin...
-
This post will talk about the basic understanding of TLS-PSK protocol. It will not cover TLS's history and how its mathematical algorit...
-
ASIC (Application Specified Integrated Circuit) is a customized integrated circuit. It is usually used by a person or company for a very li...
-
Instruction: No need to say more. It is a kind of mnemonic which can be mapped into binary code directly by translating opcode and operan...
No comments:
Post a Comment