vikramaditya234
January 8th, 2009, 02:37 AM
Hi,
The code snippet below works for Linux 32 bit but does NOT work for Linux 64 bit :
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $.LC0, %edi
call puts
mov $1447909480,%eax
mov $10,%ecx
mov $22104,%edx
inl (%dx)
movl $.LC1, %edi
call puts
leave
ret
If i change the position of print command (print command below) to print just before IN(inl) instruction, the code works.
movl $.LC0, %edi
call puts
The below code works on Linux 64 bit, the print command place is changed. It is moved just above the IN(inl) command.
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
mov $1447909480,%eax
mov $10,%ecx
mov $22104,%edx
movl $.LC0, %edi
call puts
inl (%dx)
movl $.LC1, %edi
call puts
leave
ret
Can any one tell me how can solve this problem ( i dont want to use print command to make the code work) and why is this happening.
For the reference complete assembly file is attached (It works on Linux 32 bit).
Thanks
The code snippet below works for Linux 32 bit but does NOT work for Linux 64 bit :
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $.LC0, %edi
call puts
mov $1447909480,%eax
mov $10,%ecx
mov $22104,%edx
inl (%dx)
movl $.LC1, %edi
call puts
leave
ret
If i change the position of print command (print command below) to print just before IN(inl) instruction, the code works.
movl $.LC0, %edi
call puts
The below code works on Linux 64 bit, the print command place is changed. It is moved just above the IN(inl) command.
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
mov $1447909480,%eax
mov $10,%ecx
mov $22104,%edx
movl $.LC0, %edi
call puts
inl (%dx)
movl $.LC1, %edi
call puts
leave
ret
Can any one tell me how can solve this problem ( i dont want to use print command to make the code work) and why is this happening.
For the reference complete assembly file is attached (It works on Linux 32 bit).
Thanks