내가 nasm -f macho64 asm1.asm
를 사용하는 나는 다음과 같은 오류 얻을 :Mach-O 64 비트 형식은 32 비트 절대 주소를 지원하지 않습니다. NASM
asm1.asm:14: error: Mach-O 64-bit format does not support 32-bit absolute addresses
이 asm1.asm
SECTION .data ;initialized data
msg: db "Hello world, this is assembly", 10, 0
SECTION .text ;asm code
extern printf
global _main
_main:
push rbp
mov rbp, rsp
push msg
call printf
mov rsp, rbp
pop rbp
ret
입니다 내가 어셈블리에 정말 새로 온 사람과 거의 이러한 명령이 무엇을 알고 있습니다. 뭐가 잘못 됐는지 알아?
가능한 복제본 [x64 nasm : 메모리 주소를 스택 및 호출 기능에 푸시] (http://stackoverflow.com/questions/13091987/x64-nasm-pushing-memory-addresses-onto-the-stack-call) -function) –
@MichaelFoukarakis,하지만 그 대답은 실제로'macho64'가 32 비트 절대 주소 지정을 허용하지 않는 이유를 설명하지 못합니다. 32 비트 절대 주소 지정은 elf64에서 정상적으로 작동합니다. –
@MichaelFoukarakis, http://stackoverflow.com/questions/13091987/x64-nasm-pushing-memory-addresses-onto-the-stack-call-function/13092703?noredirect=1#comment41463350_13092703으로 답변을 이동했습니다. 이 질문은 이제 중복되었습니다. –