I’m currently reading "Assembly Language step by step" by Jeff Duntemann. I’m somewhat frustrated by picture describing memory organization for protected flat model. It shows a piece of memory of 4GB size. There, instructions area is close to bottom ( low addresses), then data area above, and stack near the top. A the same time, if I understood it right, DS & CS registers in flat mode don’t affect start address of instructions or data (within those 4GB).
My question is:
who, then, distributes code and data areas (code below, data above), in those 4GB? Who decides at which address the instructions start and at which address data starts? There are some assembly programs in the book, but looks like programmer doesn’t choose memory location for instructions & data (within his ‘own’ 4GB). He just declares data section somewhere and types in the instructions. On the other hand, *.lst file already has addresses for instructions and data chunks. So is it Assembler that makes decision on addresses?