x64 Assembly Tutorial 14: The Data Segment

This is the 14th tutorial. We'll be looking at how to reserve space in RAM for our data. The data segment is just a place in memory given to our program by Windows and we can read and write to it. It's where all the global variables in a C++ program reside, as well as the static ones. It has nothing to do with dynamic memory nor local variables. I've gone into arrays here too but we'll leave structures for some other time. I'll often not give our Assembly code an explicit data segment, this is OK because C++ has already defined it. It is often the case that the data we are to work with in Assembly will be given to us by C++. Almost all of this tutorial is not Assembly but actually MASM directives. All assemblers seem to have completely different ways of reserving space in the data segment.