Motorola once sc140 User Manual

Page of 40
Compiler Support on StarCore
14
Introduction to the SC140 Tools
The following instructions require data to be aligned on the specified boundaries:
Hands On
1. Open the 
Ex4.c
 file, which contains a series of assembly instructions within a C framework using 
asm statements. For alternative (and nicer) ways of incorporating assembly code, consult the SC100 
C/C++ Compiler User’s Manual
.
2. Look at the assembly instructions to understand the wide data move instructions. Notice that the code 
comprises two sections: the first section with aligned data and the second with non-aligned data.
3. For each instruction, write the result you expect from each section in the boxes provided here (in the 
Expected Columns). Array “data[ ]” is of type long int and therefore aligns on a 4-byte boundary.
move.w (r0),d0 
2-byte boundary
move.f (r0),d0
2-byte boundary
move.2w
(r0), d0:d1
4-byte boundary
move.2f
(r0), d0:d1
4-byte boundary
move.4w
(r0),d0:d1:d2:d3
8-byte boundary
move.4f
(r0),d0:d1:d2:d3
8-byte boundary
move.l
(r0),d0
8-byte boundary
move.2l
(r0),d0:d1
8-byte boundary
move #data,r0
move.w (r0),d0
move.2w (r0),d0:d1
move.2f (r0),d2:d3
move.4w (r0),d4:d5:d6:d7 
move.2l (r0),d8:d9 
r0
d0
d0
d1
d2
d3
d4
d5
d6
d7
d8
d9
Expected
Simulator
data:
0x01
0x231
0x45
0x67
0x89
0xAB
0xCD
0xEF
0xAA
0xBB
0xCC
0xDD
0xEE
0xFF 0x11
 
0x22
First Code Section
0100
0000
00