Processors
Intel® Processors, Tools, and Utilities
14501 Discussions

Why does pushing and popping the same amount of times break my program?

IamHamidd
Beginner
469 Views

Im using x86-64 NASM on WSL Ubuntu.

I'm trying to use push/pop for function params, but for some reason it makes my program return " ".

section .text
        global _start
_start:
mov edx, len  
mov ecx, msg
push ecx
push edx
call println
mov eax, 1
int 0x80

println:
pop edx
pop ecx
mov ebx, 1     
mov eax, 4   
int 0x80        
ret

section .data

msg db "Hello world!",0xa
len equ $ - msg

this returns:

Command terminated by signal 11

Not too sure what's causing this. Does anyone know? I would like to add that removing both the pushes and both the pops makes the program run perfectly fine again.

Labels (1)
0 Kudos
2 Replies
Alberto_R_Intel
Employee
445 Views

IamHamidd, Thank you for posting in the Intel® Communities Support.

 

In reference to your inquiry, we will do further research on this matter to try to find a possible solution to this scenario or to point you in the right direction for proper technical support. As soon as I get any updates, I will post all the details on this thread.


Any questions, please let me know.


Regards,

Albert R.


Intel Customer Support Technician


0 Kudos
Alberto_R_Intel
Employee
436 Views

Hello IamHamidd, I just received an update on this matter.


After reviewing the case, since this scenario is related to software instead of hardware, there are no additional details we can provide from our side.


Still, for your convenience, you can always submit your inquiry on Ubuntu Forums and check there if they can provide further suggestions on this matter. We apologize for any inconvenience:

https://ubuntuforums.org/


Regards,

Albert R.


Intel Customer Support Technician


0 Kudos
Reply