This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
replacing assembly for C code
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Subject: replacing assembly for C code
- From: Sanjiv Kumar Gupta <sanjivg at noida dot hcltech dot com>
- Date: Mon, 22 Oct 2001 15:14:01 +0530
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