
460
APPENDIX
D.1
C Compiler (fcc911)
When programming in C, note that the operation result is unpredictable if the following
operations are performed for the little-endian area:
• Allocation of variables having initial values
• Structure insertion
• Manipulation of a non-character type array by using a character-string handling
function
• Specification of the -K lib option during use of a character-string handling function
• Using the double type and long-double type
• Allocating stacks in the little-endian area
■
Allocation of variables having initial values
A variable having an initial value cannot be allocated in the little-endian area.
The compiler has no function for generating initial values in the little-endian area. The compiler
can allocate variables in the little-endian area; however, it cannot set initial values in this area.
Perform the processing for setting the initial value at the beginning of the program.
[Example] Setting of an initial value for the variable little_data in the little-endian area
■
Structure insertion
For insertion between structures, the compiler selects the optimum transfer method to perform
transfer byte-by-byte, half word-by-half word, or word-by-word. If structure insertion is performed
between structure variables allocated in an ordinary area and those allocated in the little-endian
area, the obtained results will not be correct.
[Example] Structure insertion in the structure variable little_st of the little-endian area
The location of the structure member differs for each compiler. So, the member location may
differ from that of a structure generated by another compiler. If this occurs, the method
previously explained will not produce correct results.
extern int little_data;
void little_init(void) {
little_data = initial-value;
}
void main(void) {
little_init();
...
}
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);
}
Содержание MB91150 Series
Страница 1: ......
Страница 2: ......
Страница 3: ...FUJITSU LIMITED FR30 32 BIT MICROCONTROLLER MB91150 Series HARDWARE MANUAL ...
Страница 4: ......
Страница 10: ...vi ...
Страница 112: ...96 CHAPTER 3 MEMORY SPACE CPU AND CONTROL UNIT ...
Страница 174: ...158 CHAPTER 5 I O PORTS Note DDRI bit 6 is a test bit Always set the bit to 0 The value read from this bit is always 0 ...
Страница 178: ...162 CHAPTER 5 I O PORTS ...
Страница 214: ...198 CHAPTER 7 16 BIT RELOAD TIMER ...
Страница 240: ...224 CHAPTER 8 PPG TIMER ...
Страница 310: ...294 CHAPTER 13 8 10 BIT A D CONVERTER ...
Страница 318: ...302 CHAPTER 14 8 BIT D A CONVERTER ...
Страница 362: ...346 CHAPTER 15 UART ...
Страница 420: ...404 CHAPTER 19 PERIPHERAL STOP CONTROL ...
Страница 428: ...412 CHAPTER 20 CALENDAR MACROS ...
Страница 503: ...487 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Страница 510: ...494 INDEX ...
Страница 512: ......