0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

アセンブラAdvent Calendar 2018

Day 20

paizaでインラインアセンブラ その2

Last updated at Posted at 2018-09-21

#概要
x64で、インラインアセンブラやってみた。
helloworldやってみた。

#サンプルコード

#include <stdio.h>
#include <unistd.h>

int main()
{
    const char str[] = "Hello World!\n";
    const size_t n = sizeof(str);
    unsigned int ret;
    __asm__ volatile ("mov $1, %%rax; mov $1, %%rdi; mov %1, %%rsi; mov %2, %%rdx; syscall;" : "=a" (ret) : "S" (str), "d" (n));
    return 0;
}

#成果物

以上。

0
0
1

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?