17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

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

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

Built-in Functions<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

All devices<br />

Nothing<br />

x = 0x86;<br />

rotate_left( &x, 1);<br />

// x is now 0x0d<br />

None<br />

rotate_right(), shift_left(), shift_right()<br />

rotate_right( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

rotate_right (address, bytes)<br />

address is a pointer to memory,<br />

bytes is a count of the number of bytes to work with.<br />

undefined<br />

Rotates a bit through an array or structure. The address may be an array<br />

identifier or an address to a byte or structure (such as &data). Bit 0 of the<br />

lowest BYTE in RAM is considered the LSB.<br />

All devices<br />

Nothing<br />

Examples:<br />

struct {<br />

int cell_1 : 4;<br />

int cell_2 : 4;<br />

int cell_3 : 4;<br />

int cell_4 : 4; } cells;<br />

rotate_right( &cells, 2);<br />

rotate_right( &cells, 2);<br />

rotate_right( &cells, 2);<br />

rotate_right( &cells, 2);<br />

// cell_1->4, 2->1, 3->2 and 4-> 3<br />

Example Files:<br />

Also See:<br />

None<br />

rotate_left(), shift_left(), shift_right()<br />

255

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

Saved successfully!

Ooh no, something went wrong!