396
APPENDIX D Notes on Using Little Endian Areas
D.1
C Compiler (fcc911)
When the operations described below are performed for little endian areas from
programs in C, the results of the respective operations may be rendered uncertain.
• Allocating variables with initial values
• Assigning structures by referencing other structures
• Manipulating data other than character arrays with character string manipulation
functions
• Specifying the option -K lib when using a character string manipulation function
• Using the types double and long double
• Allocating a stack to a little endian area
■
Allocating Variables with Initial Values
Variables with initial values cannot be allocated to little endian areas.
The compiler has no function for creating the initial values of little endians. While variables can
be allocated to little endian areas, their initial values cannot be set during assignment.
Set the initial values at the beginning of the program.
[Example] When setting an initial value for the variable little_data of the little endian area
extern int little_data;
void little_init(void) {
little_data = Initial value;
}
void main(void) {
little_init();
...
}
■
Assigning Structures by Referencing Other Structures
When assigning structures by referencing other structures, the compiler selects the optimum
transfer method and performs a transfer for each byte, half-word, and word. If a structure is
defined by referencing a structure variable allocated to a little endian area and another allocated
to a non-little endian area, the correct result is not obtained.
Assign each structure member individually.
[Example] When assigning a structure to the structure variable little_st in the little
endian area
struct tag { char c; int i; } normal_st;
extern struct tag little_st;
Summary of Contents for MB91F109
Page 2: ......
Page 3: ...FUJITSU LIMITED FR30 32 Bit Microcontroller MB91F109 Hardware Manual ...
Page 4: ......
Page 10: ...vi ...
Page 24: ...xx ...
Page 96: ...72 CHAPTER 2 CPU ...
Page 224: ...200 CHAPTER 4 BUS INTERFACE ...
Page 234: ...210 CHAPTER 5 I O PORTS ...
Page 268: ...244 CHAPTER 9 U TIMER ...
Page 290: ...266 CHAPTER 10 UART ...
Page 314: ...290 CHAPTER 12 16 BIT RELOAD TIMER ...
Page 322: ...298 CHAPTER 13 BIT SEARCH MODULE ...
Page 392: ...368 CHAPTER 16 FLASH MEMORY ...
Page 432: ...408 APPENDIX E Instructions F Table E 2 Instruction Formats OP rel11 5 11 ...
Page 448: ...424 APPENDIX E Instructions ...
Page 449: ...425 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Page 458: ...434 INDEX ...
Page 460: ......
Page 461: ...FUJITSU SEMICONDUCTOR FR30 32 Bit Microcontroller MB91F109 Hardware Manual ...