Filter Function For Shift Jis Code - Epson S5U1C17001C Manual

Cmos 16-bit single chip microcontroller (c compiler package for s1c17 family) (ver. 3.1)
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

4 C Compiler

4.5 Filter Function for Shift JIS Code

 Description of function
The original GNU preprocessor/compiler is not fully compatible with the Shift JIS code (hereafter written as the "SJIS code").
This means that for an SJIS character code like "能" (0x945c), the "0x5c" part of the code will be incorrectly judged as a line
connector (\);the character code will not be processed correctly.
Example:
i_Val = 0;
i_Val = 1;
To prevent such errors, the gcc3 preprocessor/compiler incorporates a function to filter SJIS codes.
When the code "0x5c" is encountered, this filter function checks one byte immediately before that code and determines whether
"0x5c" is a line connector ('\') or the second byte of an SJIS code.
If the function determines the code constitutes the second byte of an SJIS code, it performs a process to prevent "0x5c" from
being processed as a line connector ('\').
This function is compatible with the following files:
C source files
Header files included from C source files
Assembly source files
Header files included from assembly source files
With gcc3, specify the -mno-sjis-filt option to disable this filter option.
 Notes
• The -traditional-cpp option is not supported but is available in the preprocessor. The filter function will not operate properly if
this option is specified while building a project.
The -traditional-cpp option is designed to execute a preprocess in accordance with a rule in place before ISO specifications
were established.
• If the filter process is enabled with gcc3, the output of code for a wide character (2-byte) enclosed in single quotation marks (')
will differ from output of code from versions of this package preceding 1.5.0.
The prefix "L" must be added to ensure correct output.
Example: Inserting a wide character (2-byte) "空" (SJIS code: 0x8bf3)
• When using a version before 1.5.0 or if the -mno-sjis-filt option is specified in versions 1.5.0 or later with gcc3
int i_Val = '空';
• When the -mno-sjis-filt option is not specified in versions 1.5.0 or later with gcc3
int i_Val = L'空';
4-16
// 機能
← This line is joined to the above line and processed as a comment.
→ i_Val is replaced by 0x8bf3
→ i_Val is replaced by 0x8bf3 if the prefix "L" is specified. If the prefix
"L" is not specified, i_Val is replaced by 0xfff3.
Seiko Epson Corporation
S5U1C17001C Manual
(Rev. 1.0)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the S5U1C17001C and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents