| Electronic Components Datasheet Search |
|
ST20-C1 Datasheet(PDF) 48 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
ST20-C1 Datasheet(HTML) 48 Page - STMicroelectronics |
|
48 / 205 page ![]() 4.9 Shifting and byte swapping 48/205 ® 4.8.1 Memory bit test and clear or set Bits of a word in memory may be tested and set or cleared by the instruction rmw. The address of the memory word is held in Areg and a bit masks in Breg and Creg. rmw clears the bits of the memory word that are set in Creg, and then sets the bits of the memory word that are set in Breg.The initial memory word is loaded into Areg, with Areg pushed down to Breg and Breg pushed down to Creg. 4.9 Shifting and byte swapping The shift and byte swapping operations are provided by the instructions listed in Table 4.11. The shift operations ( shl, shr and ashr) shift the operand in Breg by the number of bits specified b y the unsigned integer in Areg and put the result in Areg. shl and shr fill the vacated bit positions with zero bits, while ashr fills the v acated bits with copies of bit 31, which is the original sign bit. If Areg is zero, the result is the initial value of Breg. When the value in Areg is greater than the number of bits in the object being shifted, the result of the operation is undefined. The data previously held in Creg is popped into Breg, and the initial Breg is left in the Creg. swap32 reverses the order of the bytes in Areg by swapping byte 0 with byte 3 and swapping byte 1 with byte 2. 4.10 Function and procedure calls The function and procedure call operations are provided by the instructions listed in Table 4.12. The primary instruction fcall n calls a function or procedure. It stores the instruction pointer (which holds the return address) in the word pointed to by the Wptr. The operand to the call - n - is added to the address of the next instruction to produce the address of the first instr uction of the procedure or function being called. Since the call address is relative, the code is relocatable. Mnemonic Name shl shift left shr shift right ashr arithmetic shift right swap32 byte swap 32 Table 4.11 Shifting and byte swapping instructions Mnemonic Name fcall function call jab jump absolute ajw adjust work space gajw general adjust workspace Table 4.12 Function and procedure 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 |