© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
J. BartlettLearn to Program with Assemblyhttps://doi.org/10.1007/978-1-4842-7437-8_6

6. Working with Data in Memory

Jonathan Bartlett1  
(1)
Tulsa, OK, USA
 

While registers store the values that the CPU is actively processing, most of a program’s data is in main memory, not in registers. In this chapter, we will learn the basics of how to access main memory in assembly language.

6.1 Adding Fixed-Length Data Sections to Programs

To begin with, we will look at adding fixed-length data sections to programs.

Data sections are marked in code with the command .section .data . This will allow you to add fixed-length data sections to your program. Within the data section, ...

Get Learn to Program with Assembly: Foundational Learning for New Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.