Add tags

Add tags to the following comment

64bit Linux で NASM によるアセンブラです。 64bit ではシステムコールは int 0x80 ではなく syscall を使います。システムコール番号も違い、システムコールで使うレジスタも次の順番になります。

  1. rdi
  2. rsi
  3. rdx
  4. rcx
  5. r8
  6. r9
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
;;; nasm -f elf64 hello.asm && ld -o hello hello.o && ./hello
        bits 64
section .text
global _start
_start:
        mov rax, 1
        mov rdi, 1
        mov rsi, msg
        mov rdx, len
        syscall

        mov rax, 60
        xor rdi, rdi
        syscall

section .data
        msg     db      'Hello, world!'
        len     equ     $ - msg

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...