Fujitsu FR60 Hardware Manual page 57

Hide thumbs Also See for FR60:
Table of Contents

Advertisement

■ Structure Assignment
When structures are assigned among structures, the compiler selects the optimum transfer method and
executes transfer for each byte, halfword, and word.
As a result, the correct result will not be obtained if structure assignment spans structure variables assigned
to the regular area and structure variables assigned to the little-endian area.
Assign the members of a structure individually.
Example:
Assigning a structure to the structure variable little_st in the little-endian area
In addition, mapping of the structure members depends on the compiler. If a different compiler was used to
compile a structure, the members will be mapped differently. In this case, the correct result will not be
obtained even though the method described above is used.
If the mappings of the structure members do not match, do not map structure variables in the little-endian
area.
■ Manipulation of Arrays Other than Character-type Arrays Using Character String
Operation Functions
Character string operation functions provided as a standard library are processed in byte units.
As a result, the correct result will not be obtained if processing that uses character string operation
functions is executed for areas that have a type other than char, unsigned char, or signed char mapped in the
little-endian area.
Do not execute this type of processing.
Incorrect processing example:
Transferring word data using memcpy
The result of the executing the above code is shown below. An error occurs when word data is transferred.
struct tag { char c; int i; } normal_st;
extern struct tag little_st;
#define STRMOVE(DEST,SRC) DEST.c=SRC.c;DEST.i=SRC.i;
void main(void) {
STRMOVE(little_st,normal_st);
}
int big = 0x01020304;
extern int little;
memcpy(&little,&big,4);
(Big-endian area)
01 02 03 04
(Correct result)
/* Big-endian area */
/* Little-endian area */
/* Transfer using memcpy */
(Little-endian area)
memcpy
01 02 03 04
04 03 02 01
39

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb91350a series

Table of Contents