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.

#概要

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?