地方エンジニアの学習日記

興味ある技術の雑なメモだったりを書いてくブログ。たまに日記とガジェット紹介。

アセンブラでHello World

環境

Windows Subsystem for Linux

ソース等

  • ソース
msg: .ascii "hello, world\n"

    .globl _start

_start:
    mov $1,%rax     # write
    mov $1,%rdi # stdout
    mov $msg,%rsi   # addr
    mov $13,%rdx    # len
    syscall

    mov $60,%rax    # exit
    mov $0,%rdi # status
    syscall
$ as hello.s -o hello.o
$ ld hello.o -o hello -s