Compiler Support on StarCore
The following instructions require data to be aligned on the specified boundaries:
move.w | (r0),d0 | |
move.f | (r0),d0 | |
move.2w | (r0), d0:d1 | |
move.2f | (r0), d0:d1 | |
move.4w | (r0),d0:d1:d2:d3 | |
move.4f | (r0),d0:d1:d2:d3 | |
move.l | (r0),d0 | |
move.2l | (r0),d0:d1 |
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
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
data: | 0x01 | 0x231 0x45 0x67 0x89 0xAB | 0xCD | 0xEF | |||||||||||||||||
| 0xAA | 0xBB 0xCC 0xDD 0xEE 0xFF |
| 0x11 | 0x22 | ||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
move #data,r0 |
|
|
|
|
|
|
|
|
|
| Expected |
|
|
|
|
|
| Simulator | |||
| r0 |
|
|
|
|
|
|
|
|
|
|
|
|
| |||||||
|
| 00 | 0000 |
| 0100 |
|
|
|
|
|
|
|
| ||||||||
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 |
|
|
|
|
|
|
|
|
|
|
|
| |||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
First Code Section
14 | Introduction to the SC140 Tools |