LoginSignup
4
2

More than 5 years have passed since last update.

Linux 64bitアセンブラでhello, world

Last updated at Posted at 2019-01-14

環境

Windows Subsystem for Linux

  • Windows 10 Home 64bit
  • Ubuntu

参考:Windows Subsystem for Linuxをインストールしてみよう!

ソース等

  • ソース
hello.s
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

実行結果

hello.png

参考

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2