Exercise 3: NASM vs. GAS for a Beginner Writing Assembly by Hand — Possible Solution ==================================================================== THE ANSWER: NASM ------------------------------ Per this chapter's own reasoning, NASM is the more approachable choice for someone writing x86-64 assembly directly by hand, which is exactly the situation this entire course's own examples represent. WHY, USING THIS CHAPTER'S OWN REASONING ------------------------------ 1. Syntax: NASM uses Intel syntax, which is the exact syntax this course committed to throughout, starting explicitly in assembly2-3. Every example a beginner following this course has already seen — destination-first operand order, no %/$ prefixes — matches NASM's own conventions directly, with nothing new to relearn. 2. Workflow: per this chapter's own description, NASM has "a simple, self-contained command-line workflow" built around assembling a standalone source file directly — well suited to someone writing and testing small assembly programs on their own, exactly the kind of task a beginner would actually be doing. WHY GAS IS THE LESS NATURAL FIT HERE ------------------------------ Per this chapter's own description, GAS defaults to AT&T syntax — requiring the reversed operand order and %/$ prefixes this course deliberately set aside in assembly2-3 as "real code encountered elsewhere," not its own working syntax. GAS is also described as the assembler GCC uses INTERNALLY to emit its own generated output — meaning its most common real-world role is being read as compiler output or embedded as inline assembly inside C code, not as a standalone tool for someone hand-writing a program from scratch the way this course's own examples are written. WHY THIS WORKS AS AN ANSWER ------------------------------ It picks NASM specifically, and justifies the choice using two concrete factors named in this chapter itself — syntax matching what the learner already knows, and a workflow suited to standalone, hand-written programs — rather than a vague preference, while also explaining specifically why GAS's own typical real-world role doesn't fit a beginner's actual situation as well.