This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: What's the meaning of #APP and #NOAPP


I think are the delimiters of the assembler code you insert into C ..... asm("nop") 

the sharp (#) mean a line comment into assembly language

----------------------------------------
> Date: Fri, 9 Jul 2010 19:52:23 +0800
> Subject: What's the meaning of #APP and #NOAPP
> From: mobile.parmenides@gmail.com
> To: gcc-help@gcc.gnu.org
>
> The following C souce file is compiled and produce relevant assembly
> language file.
>
> #include 
>
> int main()
> {
> int a = 10;
> int b = 20;
> int result;
> result = a * b;
> asm ( "nop");
> printf("The result is %d\n", result);
> return 0;
> }
>
> .file "asmtest.c"
> .section .rodata
> .LC0:
> .string "The result is %d\n"
> .text
> .globl main
> .type main, @function
> main:
> pushl %ebp
> movl %esp, %ebp
> andl $-16, %esp
> subl $32, %esp
> movl $10, 28(%esp)
> movl $20, 24(%esp)
> movl 28(%esp), %eax
> imull 24(%esp), %eax
> movl %eax, 20(%esp)
> #APP
> # 10 "asmtest.c" 1
> nop
> # 0 "" 2
> #NO_APP
> movl $.LC0, %eax
> movl 20(%esp), %edx
> movl %edx, 4(%esp)
> movl %eax, (%esp)
> call printf
> movl $0, %eax
> leave
> ret
> .size main, .-main
> .ident "GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3"
> .section .note.GNU-stack,"",@progbits
>
> what's the meaning of the following slice of code?
>
> #APP
> # 10 "asmtest.c" 1
> nop
> # 0 "" 2
> #NO_APP
 		 	   		  
_________________________________________________________________
Importa i tuoi contatti di Facebook. Chiacchiera su Messenger!
http://www.windowslive.it/importaAmici.aspx


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]