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.

swap( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

swap (lvalue)<br />

lvalue is a byte variable<br />

undefined - WARNING: this function does not return the result<br />

Swaps the upper nibble with the lower nibble of the specified byte. This is the<br />

same as:<br />

byte = (byte > 4);<br />

All devices.<br />

Nothing<br />

x=0x45;<br />

swap(x);<br />

//x now is 0x54<br />

None<br />

rotate_right(), rotate_left()<br />

tolower( ) toupper( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

result = tolower (cvalue)<br />

result = toupper (cvalue)<br />

cvalue is a character<br />

An 8 bit character<br />

These functions change the case of letters in the alphabet.<br />

TOLOWER(X) will return 'a'..'z' for X in 'A'..'Z' and all other characters are<br />

unchanged. TOUPPER(X) will return 'A'..'Z' for X in 'a'..'z' and all other<br />

characters are unchanged.<br />

Availability:<br />

All devices.<br />

324

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

Saved successfully!

Ooh no, something went wrong!