0
在linux 64位彙編語言中,獲得分段錯誤和輸出不符合要求。初學者。任何幫助,將不勝感激。在我與TA教授交談之前,先尋求幫助。這裏是鏈接到該網站以供參考: http://www.cs.fsu.edu/~langley/CIS4385-2014-1/Assign2-new.htmllinux 64位彙編語言中的分段錯誤(初學者)
這裏是我的代碼至今:
.text # Start of code segment
.global _start # Declaring for linker (ld)
_start:
# String to stdout
movl $len,%edx # Argument: message length
movl $msg,%ecx # Argument: pointer to message to write
movl $1,%ebx # Argument: file handle (stdout)
movl $4,%eax # System call number (sys_write)
syscall # Invokes system calls in Linux
movl $0,%ebx # Argument: exit code
movl $1,%eax # System call number (sys_exit)
syscall # Invokes system calls in Linux
.data # Start of data segment
msg:
.ascii "Hello World (64 bit version) --- this is MY NAME!\n"
.ascii "\n"
.ascii "CIS 4385 Spring 2014\n"
len = . - msg # length of string