私はアセンブラーの学習を始めたばかりで、最初の段階で立ち往生しています.単純な関数を呼び出そうとしています. おそらく、経験豊富な誰かがこのコードの何が問題なのかを指摘することができます:
.code32
SYSEXIT = 1
.data
.text
.globl _start
_start:
push $28 #just some random argument
push $33
call myfunc
mov $SYSEXIT, %eax
#exit code is stored in ebx after calling function
int $0x80
.type myfunc, @function
myfunc:
push %ebp #save old base pointer on a stack
movl %esp, %ebp
movl 8(%ebp), %ebx #first argument to ebx
movl 12(%ebp), %ecx #second argument to ecx
addl %ecx, %ebx #add arguments together - store them in ebx
movl %ebp, %esp
pop %ebp
ret