Motorola SC140 user manual Second Code Section

Page 15

 

 

 

 

 

 

Compiler Support on StarCore

data:

0x01

0x23

0x45 0x67 0x89 0xAB 0xCD 0xEF

0xAA 0xBB 0xCC 0xDD

 

0xEE

0xFF

0x11 0x22

 

 

 

 

 

 

 

 

 

 

 

Expected

Simulator

 

 

 

 

 

 

 

move #data+2,r0

r0

 

00

 

move.w (r0),d0

 

 

 

 

 

 

 

 

 

 

 

 

 

d0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

move.2w (r0),d0:d1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d0

 

 

 

 

d1

 

 

 

 

 

 

 

 

 

 

 

move.2f (r0),d2:d3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d3

 

 

 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

move.2l (r0),d8:d9

d8

 

 

 

 

 

 

 

 

 

 

 

 

d9

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0000

0102

Second Code Section

4.Compile the Ex4.c file: ccsc100 -be Ex4.c -o Ex4.eld.

The Big Endian (-be) option is used in this exercise to make it easier to read the data in the simulator memory window. If desired, the Little Endian mode can also be used.

5.Run the GUI simulator: guisc100. In the simulator command window, type reset d m1 to put the simulator in Big Endian mode.

6.Open an assembly window: Windows->Assembly.

7.Load the file: Load Ex4.eld.

8.Set a breakpoint on “main” by typing break _main into the command window.

9.Type go. The code should now be at the start of main.

10.Open a memory window: Windows->Memory and click OK.

11.Type data into the Scroll box (of the memory window) to display the contents of the array data[ ] defined in Ex4.c. Verify that these contents are as expected.

Introduction to the SC140 Tools

15

Image 15
Contents Motorola Typical development process is represented in Figure Compiler File I/O Exercise Hands OnGood To Know Interpretation of 16-bit Integer and Fractional Data Values Integer and Fractional Arithmetic ExerciseInteger Arithmetic Compiler Support on StarCoreFractional Arithmetic Good To Know Local Optimization Local Versus Global Optimization ExerciseCompiler Support on StarCore StarCore C Compiler Global Optimization Local OptimizationMemory Alignment Exercise AA BB CC DD First Code Section Second Code Section Split Summation Exercise Code Generated Assembly Code = ∑ a i x n For 0 ≤ n L Multi-Sample ExerciseIntermediate 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 Introduction to the SC140 Tools Solutions to ExercisesAligned ExerciseExpected 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