Compile/run assembler in Linux?

后端 未结 8 1752
清歌不尽
清歌不尽 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:22

    There is also FASM for Linux.

    format ELF executable
    
    segment readable executable
    
    start:
    mov eax, 4
    mov ebx, 1
    mov ecx, hello_msg
    mov edx, hello_size
    int 80h
    
    mov eax, 1
    mov ebx, 0
    int 80h
    
    segment readable writeable
    
    hello_msg db "Hello World!",10,0
    hello_size = $-hello_msg
    

    It comiles with

    fasm hello.asm hello
    

提交回复
热议问题