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?

中古ノート、買ってみた。 その67

0
Posted at

概要

中古ノート買ってみた。
wsl1のubuntu18.04にnasm入れてみた。
gasで、intelフォーマットで書いて、gcc一発でコンパイル。

手順

アセンブラを書く。

asm.s

.intel_syntax noprefix
.global main

.text
main:
	push 	rbp
	mov 	rbp, rsp

	mov		rsi, 255
	lea 	rdi, fmt[rip]
	mov 	rax, 0
	call 	printf@PLT

	mov		rax, 0
	mov 	rsp, rbp
	pop 	rbp
	ret

.data
	fmt:  .string "value = %lX\n"

コンパイル、実行

# gcc -o asm asm.s

# ./asm
value = FF

以上。

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?