01.03.2013 Views

CSE-Semaphore TWinSoft Manual - ioSelect

CSE-Semaphore TWinSoft Manual - ioSelect

CSE-Semaphore TWinSoft Manual - ioSelect

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Bit manipulations<br />

Wraparound means that the bits scrolling from one side of a byte (8 bits) or word (16 bits) are<br />

replaced at the other side of the byte or word.<br />

bit (A,BitNb) = Bit The status of digital 'Bit' will be copied in the analog 'A' at the<br />

position indicated by 'BitNb', starting with ' 0 ' for Lsb.<br />

Example: Bit: 1<br />

BitNb: 3<br />

A: 0011010011001001<br />

Bit = bit( A,BitNb) The status of the bit of the analog 'A' indicated by 'BitNb' will<br />

be copied in the digital 'Bit', starting with ' 0 ' for Lsb.<br />

Example: A: 1100101000010010<br />

BitNb: 5<br />

Bit: 0<br />

A = shl(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the left<br />

(max. 15) of the word 'B'<br />

(without wraparound).<br />

Example: B: 0000000011111111<br />

Shift: 4<br />

A: 0000111111110000<br />

A = shr(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the right<br />

(max. 15) of the word 'B'<br />

(without wraparound).<br />

Example: B: 0000000011111111<br />

Shift: 4<br />

A: 0000000000001111<br />

A = rol byte(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the left<br />

(max. 7) of the byte 'B'<br />

(with wraparound).<br />

A = ror byte(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the right<br />

(max. 7) of the byte 'B'<br />

(with wraparound).<br />

A = rol word(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the left<br />

(max. 15) of the word 'B'<br />

(with wraparound).<br />

Example: B: 0000000011111111<br />

Shift: 4<br />

A: 0000111111110000<br />

A = ror word(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the right<br />

(max. 15) of the word 'B'<br />

(with wraparound).<br />

Example: B: 0000000011111111<br />

Shift: 4<br />

A: 1111000000001111<br />

<strong>TWinSoft</strong>: 8.32 – Getting Started 38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!