Motorola SC140 user manual Exercise, Aligned

Page 28

Compiler Support on StarCore

}

printf("The integer result is: %d (0x%x)\n",res,res);

printf("The fractional result is: %d (0x%x)\n",fres,fres);

}

Exercise 3:

No code modification is required.

Exercise 4:

data:

0x01 0x23 0x45 0x67 0x89 0xAB 0xCD 0xEF

 

0xAA 0xBB 0xCC 0xDD 0xEE 0xFF 0x11 0x22

 

 

 

 

 

 

 

 

Expected

 

move #data,r0

r0

 

 

 

 

 

 

 

 

 

d0

 

 

 

 

 

 

 

 

move.w (r0),d0

 

 

 

00

0000

 

0123

 

 

 

 

 

 

 

move.2w (r0),d0:d1

d0

 

 

00

0000

 

0123

 

 

 

 

 

 

 

d1

 

 

00

0000

 

4567

move.2f (r0),d2:d3

 

 

 

 

 

 

 

 

 

 

d2

 

 

 

00

0123

 

0000

 

 

 

 

 

 

 

 

 

 

 

 

d3

 

 

 

00

4567

 

0000

 

 

 

 

 

 

 

 

 

move.4w (r0),d4:d5:d6:d7

d4

 

 

00

0000

 

0123

 

d5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00

0000

 

4567

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d6

 

 

 

 

 

FF

FFFF

 

89AB

 

d7

 

 

 

 

 

 

 

 

 

 

 

 

 

FF

FFFF

 

CDEF

move.2l (r0),d8:d9

d8

 

 

 

 

 

 

 

 

 

 

00

0123

 

4567

 

d9

 

 

 

 

 

 

 

 

 

 

 

 

 

FF

89AB

 

CDEF

 

 

 

 

 

 

 

 

 

 

 

Aligned

Simulator

 

 

 

00

0000

0123

 

 

 

 

 

 

00

0000

0123

 

 

 

 

 

 

 

 

 

 

 

00

0000

4567

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00

0123

0000

 

 

 

 

 

 

 

 

00

4567

0000

 

 

 

 

 

 

 

 

 

 

 

 

 

00

0000

0123

 

 

 

 

 

00

0000

4567

 

 

 

 

FF

FFFF

89AB

 

 

 

 

 

 

 

 

 

 

 

FF

FFFF

CDEF

 

 

 

 

 

 

 

 

 

 

00

0123

4567

 

 

 

 

 

 

 

 

 

 

 

FF

89AB

CDEF

 

 

 

 

 

 

 

28

Introduction to the SC140 Tools

Image 28
Contents Motorola Typical development process is represented in Figure Compiler Hands On File I/O ExerciseGood 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