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

Page 15
Image 15
Motorola SC140 user manual Second Code Section