|
CC78K0S Datasheet, PDF (339/520 Pages) NEC – C Compiler Ver.1.30 or Later Language | |||
|
◁ |
(8) ASM statements
ASM Statements
CHAPTER 11 EXTENDED FUNCTIONS
#asm, #endasm
_ _asm
FUNCTION
(a) #asm - #endasm
⢠The assembler source program described by the user can be embedded in an assembler source file to
be output by this C compiler by using the preprocessing directives #asm and #endasm.
⢠#asm and #endasm lines will not be output.
(b) _ _asm
⢠An assembly instruction is output by describing an assembly code to a character string literal and is
inserted in an assembler source.
EFFECT
⢠The global variables of the C source can be manipulated in the assembler source
⢠Functions that cannot be described in the C source can be implemented
⢠The assembler source output by the C compiler can be hand-optimized and embedded in the C source (to
obtain efficient objects)
USAGE
(a) #asm - #endasm
⢠Indicate the start of the assembler source with the #asm directive and the end of the assembler source
with the #endasm directive. Describe the assembler source between #asm and #endasm.
#asm
.
.
.
#endasm
/*assembler source*/
(b) _ _asm
⢠Use of _ _asm is declared by the #pragma asm specification made at the beginning of the module in
which the ASM statement is to be described (uppercase letters and lowercase letters are distinguished
for the keywords following #pragma).
⢠The following items can be described before #pragma asm.
⢠Comments
⢠Other #pragma directives
⢠Preprocessing directives that neither define nor reference variables or functions
⢠The ASM statement is described in the following format in the C source.
_ _asm (string literal);
⢠The description method of a character string literal conforms to ANSI, and a line can be continued by using an
escape character string (\n: line feed, \t: tab) or ¥, or character strings can be linked.
Userâs Manual U14872EJ1V0UM
339
|
▷ |