This is the mail archive of the gcc@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]

replacing assembly for C code


Hi,
I am new to this list. Looking for some help.
 
I have a C file containing statements like
 
/* File.c            */
 
           Sp -- ;
           sp[0].t.vaddr = 0;
 
when I generate assembly for this file using gcc -S option, the assembly
code corresponding to above lines comes out to be as
 
/* file.s */
         mov.w   .L4222,r7
        add     r14,r7
        mov.l   @(36,r7),r0
        add     #-8,r0
        mov.l   r0,@(36,r7)
        mov     #0,r1
        mov.w   .L4223,r2
        add     r14,r2
        mov.l   @r2,r2
        mov.l   r1,@r2
 
now when I replace the C code in the original c files using asm  and
compile. My code does not work.  Which is
/* file .c */
 
           /*
Sp -- ;
           sp[0].t.vaddr = 0;
           */
 
           __asm__ volatile ("         mov.w   .L4222,r7
        add     r14,r7
        mov.l   @(36,r7),r0
        add     #-8,r0
        mov.l   r0,@(36,r7)
        mov     #0,r1
        mov.w   .L4223,r2
        add     r14,r2
        mov.l   @r2,r2
        mov.l   r1,@r2"
           );
 
Thanks in advance for any Help.
 
--regards
sanjiv


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