見出し画像

NASM Tutorial

NASM Tutorial

第1
NASM Tutorial

あ)まずhelloworld
hello.asm
; ----------------------------------------------------------------------------------------
; Writes "Hello, World" to the console using only system calls. Runs on 64-bit Linux only.
; To assemble and run:
;
; nasm -felf64 hello.asm && ld hello.o && ./a.out
; ----------------------------------------------------------------------------------------

      global    _start

      section   .text

_start: mov rax, 1 ; system call for write
mov rdi, 1 ; file handle 1 is stdout
mov rsi, message ; address of string to output
mov rdx, 13 ; number of bytes
syscall ; invoke operating system to do the write
mov rax, 60 ; system call for exit
xor rdi, rdi ; exit code 0
syscall ; invoke operating system to exit

      section   .data

message: db "Hello, World", 10 ; note the newline at the end
い)nasm -felf64 hello.asm && ld hello.o && ./a.out

hello world 表示されている

第2
【アセンブラ学習】学習環境

内容理解できない

第3
ありの日記

第3 結論
あ)ます本を購入し基本を勉強する

以上

この記事が気に入ったらサポートをしてみませんか?