SECTION .text
global main
extern puts
SECTION .text
main:
mov rdi, message; rdi string target reg
call puts
ret
message: db "this is funky", 0
编译命令
nasm -felf64 usr_c.asm
gcc usr_c.o -o use_c -no-pie
这篇博客主要展示了如何使用NASM编译器和GCC将汇编语言代码转换为可执行文件。示例代码是一个简单的程序,它调用puts函数输出字符串thisisfunky。
SECTION .text
global main
extern puts
SECTION .text
main:
mov rdi, message; rdi string target reg
call puts
ret
message: db "this is funky", 0
编译命令
nasm -felf64 usr_c.asm
gcc usr_c.o -o use_c -no-pie
1582
997

被折叠的 条评论
为什么被折叠?