问题描述
我是 nasm 的新手并编写了以下代码:
section .text
global _start
; just experimenting with functions
do_something:
mov DWORD [esp+0],1;
mov DWORD [esp+4],1;
mov DWORD [esp+0],0;
mov DWORD [esp+4],0;
ret ;
_start:
mov ecx,.Const.0;
mov edx,.Const.0.length;
call log ;
xor ecx,ecx ;
xor edx,edx ;
call do_something
xor ebx,ebx
mov eax,1
int 0x80
.Const.0:
DB "Hello World!",0xA
.Const.0.length equ $-.Const.0
但是在调用“hello_world”函数时,我得到了一个分段错误,看起来是 esp 寄存器在放入函数时导致了问题。任何帮助将不胜感激:D
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)