aarch64汇编开发环境有哪些

149 阅读1分钟

目录

  • GNU GCC + QEMU + GDB
  • ARM汇编在线仿真器
  • C语言/汇编在线转换工具
  • 在线指令速查网站
  • cemu 汇编模拟器

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

image.png

image.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文件

  1. hello_world:hello_world.o
  2.      aarch64-linux-gnu-ld -o hello_world hello_world.o
    
  3. hello_world.o:hello_world.s
  4.      aarch64-linux-gnu-as -o hello_world.o hello_world.s
    
  5. clean:
  6.      rm hello_world.o
    

执行hello_world程序

image.png hello_world代码的程序解释

image.png

ARM汇编在线仿真器

http://163.238.35.161/~zhangs/arm64simulator/

image.png

C语言/汇编在线转换工具

godbolt.org/

image.png

在线指令速查网站

hehezhou.cn/A64-2024/

image.png

cemu 汇编模拟器

image.png 添加威♥:sami01_2023,回复ARM中文,领取ARM中文手册