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 |