Just to make it easier I compiler a version which works
Code:
#include <stdio.h>
int main()
{
char p[100];
scanf("%s",p);
printf("%s",p);
}
Assembler
Code:
.file "null.c"
.def ___main; .scl 2; .type 32; .endef
.section .rdata,"dr"
LC0:
.ascii "%s\0"
.text
.globl _main
.def _main; .scl 2; .type 32; .endef
_main:
pushl %ebp
movl %esp, %ebp
subl $152, %esp
andl $-16, %esp
movl $0, %eax
addl $15, %eax
addl $15, %eax
shrl $4, %eax
sall $4, %eax
movl %eax, -124(%ebp)
movl -124(%ebp), %eax
call __alloca
call ___main
leal -120(%ebp), %eax
movl %eax, 4(%esp)
movl $LC0, (%esp)
call _scanf
leal -120(%ebp), %eax
movl %eax, 4(%esp)
movl $LC0, (%esp)
call _printf
leave
ret
.def _printf; .scl 2; .type 32; .endef
.def _scanf; .scl 2; .type 32; .endef