Compile/run assembler in Linux?

后端 未结 8 1791
清歌不尽
清歌不尽 2020-12-22 18:05

I\'m fairly new to Linux (Ubuntu 10.04) and a total novice to assembler. I was following some tutorials and I couldn\'t find anything specific to Linux. So, my question is,

8条回答
  •  情歌与酒
    2020-12-22 18:33

    For Ubuntu 18.04 installnasm . Open the terminal and type:

    sudo apt install as31 nasm

    nasm docs

    For compiling and running:

    nasm -f elf64 example.asm # assemble the program  
    ld -s -o example example.o # link the object file nasm produced into an executable file  
    ./example # example is an executable file
    

提交回复
热议问题