17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Built-in Functions<br />

make32( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

i32 = MAKE32(var1, var2, var3, var4)<br />

var1-4 are a 8 or 16 bit integers. var2-4 are optional.<br />

A 32 bit integer<br />

Makes a 32 bit number out of any combination of 8 and 16 bit numbers. Note<br />

that the number of parameters may be 1 to 4. The msb is first. If the total bits<br />

provided is less than 32 then zeros are added at the msb.<br />

All devices<br />

Nothing<br />

Examples:<br />

int32 x;<br />

int y;<br />

long z;<br />

x = make32(1,2,3,4); // x is 0x01020304<br />

y=0x12;<br />

z=0x4321;<br />

x = make32(y,z); // x is 0x00124321<br />

x = make32(y,y,z); // x is 0x12124321<br />

Example Files:<br />

Also See:<br />

ex_freqc.c<br />

make8(), make16()<br />

malloc( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

ptr=malloc(size)<br />

size is an integer representing the number of byes to be allocated.<br />

A pointer to the allocated memory, if any. Returns null otherwise.<br />

The malloc function allocates space for an object whose size is specified by<br />

size and whose value is indeterminate.<br />

All devices<br />

#INCLUDE <br />

219

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

Saved successfully!

Ooh no, something went wrong!