LoginSignup
0
0

More than 3 years have passed since last update.

概要

wslでubuntuやってみた。
syscall調べてみた。

x86 syscall

動かん。Segmentation fault (core dumped)

.code32
.text
.global main

main:
    mov     $4, %eax
    mov     $1, %ebx
    mov     $msg, %ecx
    mov     $6, %edx
    int     $0x80
    ret

.data
msg:
    .ascii  "hello "



x64 syscall

動く。

.code64
.text
.global main

main:
    mov    $msg, %rsi
    mov    $1, %rdi
    mov    $6, %rdx
    mov    $1, %rax
    syscall
    ret

.data
msg:
    .ascii  "hello "

以上。

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