baron · 6 天前

aarch64汇编开发环境有哪些

GNU GCC + QEMU + GDB
安装ARM交叉编译器:
sudo apt install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
安装QEMU环境:
sudo apt install qemu qemu-user qemu-user-static
安装gdb环境
sudo apt install gdb-multiarch
68a7f91a554a44e382c5b2247ce458fb.png6b43a66a1e494abdbb3f8c0f3023c812.png
编写汇编代码:hello_world.s

  1. .section .data
  2. msg: .asciz "Hello, AArch64!\n"
  3. .section .text
  4. .global _start
  5. _start:
  6. // Write the string to stdout
  7. mov x0, 1 // File descriptor (stdout)
  8. ldr x1, =msg // Load the address of the string
  9. mov x2, 16 // Length of the string
  10. mov x8, 64 // syscall: write
  11. svc 0 // Make syscall
  12. // Exit the program
  13. mov x8, 93 // syscall: exit
  14. mov x0, 0 // Exit status
  15. svc 0 // Make syscall
    编写Makefile文件
  16. hello_world:hello_world.o
  17. aarch64-linux-gnu-ld -o hello_world hello_world.o
  18. hello_world.o:hello_world.s
  19. aarch64-linux-gnu-as -o hello_world.o hello_world.s
  20. clean:
  21. rm hello_world.o

执行hello_world程序
610903da36b441a3aa1264071b67a0c1.pnghello_world代码的程序解释
74e379d51fb54b6296a1b14d8643282b.pngARM汇编在线仿真器
http://163.238.35.161/~zhangs...
1188ac0838ae425e9d098bb0f60d0350.png
C语言/汇编在线转换工具
https://godbolt.org/
d0ba04a9beab4cbcb7b394fb480248c4.png
在线指令速查网站
http://hehezhou.cn/A64-2024/
8200d7d391144517a2aa53661887ed3c.pngcemu 汇编模拟器
eec7987674834880b3b31eaa724227e5.png

推荐阅读
关注数
9491
文章数
235
vx: coding_the_world
目录
极术微信服务号
关注极术微信号
实时接收点赞提醒和评论通知
安谋科技学堂公众号
关注安谋科技学堂
实时获取安谋科技及 Arm 教学资源
安谋科技招聘公众号
关注安谋科技招聘
实时获取安谋科技中国职位信息