data.asm の作成
CoddyのAssemblyジャーニー「基礎」セクションの一部。レッスン 44/45。
チャレンジ
プログラムが Hello, World! followed by a newline を出力するための data.asm ファイルを作成します。
必要なもの:
- A .data section
- label msg を持ち、Hello, World! と newline (0x0a) を含む string
- msgLen called の constant that calculates the length automatically using $ - msg
これを別のファイルに入れる理由:
Chapter 0 の2ファイルパターンを思い出してください:
data.asmはすべての data definitions を保持しますmain.asmは%include "data.asm"を使ってこのファイルを include します(これは次のレッスンで扱います)
自分で試してみよう
基礎のすべてのレッスン
自分で練習してみよう: Assemblyプレイグラウンド