The __asm() function or #asm-#endasm is used to write assembly-language code within functions for the CA78K0, whereas inline expansion is performed for the assembly-language functions declared in #pragma inline_asm for the CC-RL. The CcnvCA78K0 creates the __asm() function or the inline_asm function that executes assembly instructions in the range between #asm and #endasm at the beginning of the file and converts the program so that this function is called at the position where an assembly instruction is written.
The format of the CA78K0 is as follows.
The format of the CC-RL is as follows.
#pragma inline_asm [(] function-name [, ... ] [)] function-declaration { : /* assembly-language code */ } |
Since the instruction set or specifications of instructions are different between the 78K0 and RL78, the assembly-language code has to be manually modified. A message is output at conversion. |
The function name to be created should be in the range between __inline_asm_func_00000 and __inline_asm_func_99999, and an error will occur if the number of functions exceeds 100,000. |
If a label is in the range between #asm and #endasm or in the __asm function, the CcnvCA78K0 outputs a message. If a label is written in a function for which #pragma inline_asm is specified in the CC-RL, an error will occur at compilation. Therefore, if a label is in #asm-#endasm or the __asm function, the CcnvCA78K0 outputs a message. A label written in the assembly language needs to be changed to a local label to avoid a compile error. For details, see the user's manual of the CC-RL. |
If double quotation marks (") are included in the target to be converted by the #define macro as shown in the example below, the inline_asm function cannot be generated from the __asm( ) function. In such a case, the CcnvCA78K0 outputs a message. The input file is directly output without its contents being converted. Perform conversion after expanding the macro in advance. |
If control characters like '\n' or '\t' are included in a string in __asm( ), an assembly error will occur after conversion. Perform conversion after deleting the control characters in advance. |
If a C-language comment ("/*") is included in the assembly-language comments (";") in the range between #asm and #endasm, the range of the comment is invalid. Perform conversion after deleting the comments in advance. |