Compiler Support on StarCore

}

Exercise 7: /*****************************************************************************

*

MOTOROLA INC.

*

SEMICONDUCTOR PRODUCTS SECTOR

*

COPYRIGHT 1999 MOTOROLA INC.

*******************************************************************************

*

INTRODUCTION TO THE SC140 TOOLS

*

Developed by MOTOROLA SPS/NCSG/WISD

*******************************************************************************/

short array1[10]={1,-1,-1,-2,2,-2,2,-2,3,-3}; short array2[10];

main()

{

short i;

short *array2_ptr; short tmp;

array2_ptr = &array2[0];

for(i=0;i<10;i++)

{

tmp = array1[i]; if( tmp < 0)

{

tmp = -tmp;

}

*array2_ptr++ = tmp;

}

}

36

Introduction to the SC140 Tools

Page 36
Image 36
Motorola SC140 user manual Motorola INC