section .data
A db 0 ; 計算結果を1文字で入れる場所
section .text
global _start
_start:
; --- 計算 ---
mov rax, 2
imul rax, 2
imul rax, 2
; --- 数値 → ASCII 1文字に変換 ---
add rax, '0'
mov [A], al ; 結果をメモリに1バイト書く
; --- 出力(write)---
mov rax, 1
mov rdi, 1
mov rsi, A
mov rdx, 1
syscall
; --- exit(0) ---
mov rax, 60
xor rdi, rdi
syscall
To embed this project on your website, copy the following code and paste it into your website's HTML: