| Electronic Components Datasheet Search |
|
ST20-C1 Datasheet(PDF) 47 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
ST20-C1 Datasheet(HTML) 47 Page - STMicroelectronics |
|
47 / 205 page ![]() 47/205 4 Using ST20-C1 instructions ® In other languages, evaluation of boolean expressions may be strict (for example, ADA gives the programmer the choice) and so both expressions in dyadic logical opera- tions may need to be evaluated. Where false is represented by 0, and true is represented by any fixed bit pattern other than 0 (e.g. true is always 1, or true is always -1), then the following transformations apply: X OR Y = X BITOR Y X AND Y = X BITAND Y and the bitwise instructions given in section 4.8 can be used: Note that even for some non-strict evaluations, the above sequence may be prefer- able. Where Y is a simple boolean expression such as a local variable, its evaluation does not cause any side-effects, and so it does no harm to implement a non-strict evaluation using a bitwise operation. 4.8 Bitwise logic and bit operations Bitwise logic and bit operations are provided by the instructions listed in Table 4.10. The not operation has only one operand that is taken from Areg. The result of this, which is a bitwise inversion of all bits in the operand, is loaded into Areg, leaving Breg and Creg unaffected. and, or and xor are bitwise logical operations on two operands that are taken from Areg and Breg. For each, the result is loaded into Areg. The data previously held in Creg is popped into Breg and the initial Areg is left in Creg. These operations are commutative. bitld, bitst and bitmask are used for setting, clearing and testing bits of a word. bitld returns the value of a single bit from a value in Breg, bitst sets or clears a single bit and bitmask creates a mask with a single bit set. In each case the bit number is initially in Areg and the result is put in Areg. For bitld and bitst, the value containing the bit to be tested, set or cleared is initially in Breg. Mnemonic Name and and or or xor exclusive or not bitwise not bitld bit load bitst bit store bitmask bit mask rmw memory read modify write Table 4.10 Bitwise logic and bit instructions |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |