Fujitsu MB91F109 FR30 Hardware Manual page 421

Fr30 series 32-bit microcontroller
Table of Contents

Advertisement

#define STRMOVE(DEST,SRC) DEST.c=SRC.c;DEST.i=SRC.i;
void main(void) {
STRMOVE(little_st,normal_st);
}
Moreover, as the member allocation for a structure is different for each compiler, it may differ
from that of another compiler. In this a case, the correct result cannot be acquired.
When the member allocations for structures differ, do not allocate the corresponding structure
variables to a little endian area.
Manipulating Data Other Than Character Arrays with a Character String Manipulation Function
Character string manipulation functions provided by standard libraries perform processing in
byte-units. Therefore, the character string manipulation function does not produce the correct
results for variables of types other than char, unsigned char, and signed char, which are
allocated to little endian areas. Do not perform such operations.
[Example of incorrect processing] Transfer of word data by memcpy
int big = 0x01020304;
extern int little;
memcpy(&little,&big,4); /* Transfer by memcpy */
The result of the above transfer is rendered incorrect by word data transfer as follows:
(Big endian area)
01
02
Specifying the Option -K Lib when Using a Character String Manipulation Function
When the -K lib option is specified, the compiler performs inline expansion for various character
string manipulation functions. In this case, these functions may employ processing in half-word
or word units to optimize processing.
executed incorrectly.
When processing a little endian area using a character string manipulation function, do not
specify the option -K lib. Also, do not specify the option -04 and -K speed, which include the
option -K lib.
Using the Types Double and Long Double
When variables of the types double and long double are accessed, the upper and lower word
are accessed, respectively. Therefore, if double and long double type variables allocated to
little endian areas are accessed, the correct result cannot be acquired.
Variables of the same type allocated to little endian areas can be assigned to each other. As a
result of optimization, however, these assigned variables may be replaced with constants.
/* Big endian area
/* Little endian area
memcpy
03
04
(Correct result)
APPENDIX D Notes on Using Little Endian Areas
*/
*/
(Little endian area)
01
02
04
03
Therefore, the processing for little endian areas is
03
04
01
02
397

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb91f109

Table of Contents