OS開発(基礎知識) 【OS開発の基礎知識】Rustのインラインアセンブリ(asm!・global_asm!)入門:構文・オペランド・optionsと安全な使い分け
Rust製x86_64自作OSで頻繁に登場するcore::arch::asm!・global_asm!・naked_asm!の構文を基礎から解説します。Intel構文の読み方(AT&T構文との違いや[...]/leaの意味)、in/out/inout/lateoutのオペランド、options(nomem, nostack, preserves_flags, readonly, noreturn)の安全な使い方、LLVMの予約レジスタ(rbx)退避まで具体例と図解で整理します。
