Motorola SC140 user manual Motorola INC

Page 36

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

Image 36
Contents Motorola Typical development process is represented in Figure Compiler File I/O Exercise Hands OnGood To Know Integer and Fractional Arithmetic Exercise Interpretation of 16-bit Integer and Fractional Data ValuesCompiler Support on StarCore Integer ArithmeticFractional Arithmetic Good To Know Local Versus Global Optimization Exercise Local OptimizationCompiler Support on StarCore StarCore C Compiler Local Optimization Global OptimizationMemory Alignment Exercise AA BB CC DD First Code Section Second Code Section Split Summation Exercise Code Generated Assembly Code Multi-Sample Exercise = ∑ a i x n For 0 ≤ n LIntermediate Version Compromise Between Memory and Speed Further Speed Optimization Control Code The True Bit Exercise Save Ex7.c as Ex71.c Calling an Assembly Routine From C Exercise Current Following output should be displayed Challenge Solutions to Exercises Introduction to the SC140 ToolsExercise AlignedExpected Motorola INC Intermediate version Compromise between Memory and Speed Compiler Support on StarCore Further Optimizing the Speed Compiler Support on StarCore Compiler Support on StarCore Motorola INC Zoffset equ Moffset equ Exercise Compiler Support on StarCore Compiler Support on StarCore AN2009/D