Writing data.asm
Part of the Fundamentals section of Coddy's Assembly journey — lesson 44 of 45.
Challenge
Create a data.asm file for a program that prints Hello, World! followed by a newline.
You need:
- A .data section
- A string with label msg containing Hello, World! and a newline (0x0a)
- A constant called msgLen that calculates the length automatically using $ - msg
Why this goes in a separate file:
Remember the two-file pattern from Chapter 0:
data.asmholds all data definitionsmain.asmwill include this file with%include "data.asm"
Try it yourself
All lessons in Fundamentals
1The Machine
What is CPUMemoryRegisters vs MemoryHow instructions workTwo-File PatternThe x86-64 Architecture