- 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)
Chapter 3 — The Molt
(This story is written by me and I will be posting it on Royal Road. Profile: https://www.royalroad.com/profile/1129550/fictions) Six fifty ...
-
ASIC (Application Specified Integrated Circuit) is a customized integrated circuit. It is usually used by a person or company for a very li...
-
This post will talk about the basic understanding of TLS-PSK protocol. It will not cover TLS's history and how its mathematical algorit...
No comments:
Post a Comment