Motorola SC140 user manual Compiler Support on StarCore

Page 32

Compiler Support on StarCore

* y[18] = 0x0DC0

*

* y[19] = 0x0D80

*

* y[20] = 0x0D40

*

* y[21] = 0x0D00

*

* y[22] = 0x0CC0

*

* y[23] = 0x0C80

*

* y[24] = 0x0C40

*

* y[25] = 0x0C00

*

* y[26] = 0x0BC0

*

* y[27] = 0x0B80

*

* y[28]

= 0x0B40

*

* y[29]

= 0x0B00

*

* y[30]

= 0x0AC0

*

* y[31]

= 0x0A80

*

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

main()

{

long res0, res1, res2, res3; short var0, var1, var2, var3; short n, i, *x_ptr;

x_ptr = &input[14]; /* x_ptr points to input[11], which is x[3] */

for(n=0; n<32; n+=4)

{

res0 = 0; res1 = 0; res2 = 0; res3 = 0;

var3 = *x_ptr--; /* var3 = x[n+3] */ var2 = *x_ptr--; /* var3 = x[n+2] */

var1

=

*x_ptr--;

/*

var3

=

x[n+1] */

var0

=

*x_ptr--;

/*

var3

=

x[n] */

/*** x_ptr now points to x[n-1] ***/

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

{

res0 = L_mac(res0, a[i], var0); res1 = L_mac(res1, a[i], var1); res2 = L_mac(res2, a[i], var2); res3 = L_mac(res3, a[i], var3);

var3 = var2; var2 = var1; var1 = var0;

32

Introduction to the SC140 Tools

Image 32
Contents Motorola Typical development process is represented in Figure Compiler Good To Know File I/O ExerciseHands On 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