
461
APPENDIX D Notes on Using the Little-Endian Area
If structure member locations do not match, do not allocate structure variables in the little-
endian area.
■
Manipulation of a non-character type array by using a character-string handling function
The character-string handling functions provided in the standard library perform processing in
units of bytes. They will therefore not produce correct results if processing is performed by using
a character-string handling function for an area with a type other than char, unsigned char, and
signed char allocated in the little-endian area.
Do not attempt to perform such processing.
[Erroneous example] Transfer of word data with memcpy
The execution result of the above example is shown below. It is wrong as result of a word-data
transfer.
■
Specification of the -K lib option during use of a character-string handling function
When the -K lib option is specified, the compiler performs inline expansion for some character-
string handling functions. To optimize processing, the compiler may change the processing to
half word-level or word-level processing.
This type of processing does therefore not lead to the correct results for a little-endian area.
When processing is performed for the little-endian area by using character-string-handling
functions, do not specify the -K lib option.
Do not specify the -04 option, which contains the -K lib option, or the -K speed option.
int big = 0x01020304; /* Big-endian area */
extern int little; /* Little-endian area */
memcpy(&little,&big,4); /* Transfer with memcpy */}
01 02
03
04
01 02
03
04
04 03
02
01
(Big-endian area)
(Little-endian area)
(Correct result)
memcpy
Summary of Contents for MB91150 Series
Page 1: ......
Page 2: ......
Page 3: ...FUJITSU LIMITED FR30 32 BIT MICROCONTROLLER MB91150 Series HARDWARE MANUAL ...
Page 4: ......
Page 10: ...vi ...
Page 112: ...96 CHAPTER 3 MEMORY SPACE CPU AND CONTROL UNIT ...
Page 178: ...162 CHAPTER 5 I O PORTS ...
Page 214: ...198 CHAPTER 7 16 BIT RELOAD TIMER ...
Page 240: ...224 CHAPTER 8 PPG TIMER ...
Page 310: ...294 CHAPTER 13 8 10 BIT A D CONVERTER ...
Page 318: ...302 CHAPTER 14 8 BIT D A CONVERTER ...
Page 362: ...346 CHAPTER 15 UART ...
Page 420: ...404 CHAPTER 19 PERIPHERAL STOP CONTROL ...
Page 428: ...412 CHAPTER 20 CALENDAR MACROS ...
Page 503: ...487 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Page 510: ...494 INDEX ...
Page 512: ......