Sorry I don't have the time or the inclination to debug your code but there are two things you can do. First, run the code under gdb like so:
When it segfaults, it will stop. Then type:
It will print the instruction that caused the segfault, followed by three more instructions. This should help you to investigate.
Another thing worth trying is to install the program "valgrind" and run your app under that:
It will tell you if your code is doing anything wrong like illegal reads/writes amongst other stuff.
MIHIP: You made some very basic mistakes there when copying the code. Assembly coding requires a lot of attention to the details. And the suggestion above to use a debugger is very good. With a bit of patience you will learn a lot about what is happening by following through with the debugger.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum