Сегментная структура программ. Стек

Слайд 2

1. What is a structure of a system? Structure of system

1. What is a structure of a system?

Structure of system is

actually a set of its elements and interconnections (interfaces) among them that determine a system's composition and functioning, its properties and stability.
Слайд 3

Слайд 4

mov AX,data assume CS:code,DS:data end begin

mov AX,data
assume CS:code,DS:data
end begin

Слайд 5

Text of any program includes key words, which may be divided

Text of any program includes key words, which may be divided

into: instructions(commands) of processor and directives(pseudo-instructions) of translator.
Instructions(commands) are such expressions, which determine concrete operations to be executed by the computer (each instruction determines only one operation) and their (its) operands.
Directives(pseudo-instructions) are intended for the transfer of service information to the translator, which is necessary during the process of the program assembling.
Слайд 6

2. What (simplest) type of elements does a standard assembly program

2. What (simplest) type of elements does a standard assembly program

include?

Standard assembly program includes different (simplest) types of elements or key words, which may be divided into: instructions (commands) of processor and directives (pseudo-instructions) of translator. From these elements corresponding sentences (statements or lines) are composed.

Слайд 7

Слайд 8

3. What is a segment of a program in Assembly? Segment

3. What is a segment of a program in Assembly?

 Segment

in Assembly program is a part of it used to contain a specific type of statements (or data).
Слайд 9

Слайд 10

4. What types of program segments are used in Assembly? One

4. What types of program segments are used in Assembly?

One segment is

used to contain instruction codes, another segment stores the data elements, and a third segment keeps the program stack.
Слайд 11

5. What is for is data segment used in Assembly? Data

5. What is for is data segment used in Assembly?

Data

segment − It is used to declare the memory region, where data elements are stored for the program. This section cannot be expanded after the data elements are declared, and it remains static throughout the program.
Слайд 12

7. What is for is code segment used in Assembly? Code

7. What is for is code segment used in Assembly?

Code

segment − It is represented by text section. This defines an area in memory that stores the instruction codes. This is a fixed area.
Слайд 13

8. What is for is stack segment used in Assembly? The

8. What is for is stack segment used in Assembly?

The stack memory segment is

an area of memory allotted for automatic variables. Automatic variables are allocated and de-allocated automatically when program flow enters and leaves the variable's scope. Stack memory is allocated and de-allocated at the top of the stack, using Last-In-First-Out (LIFO).
Слайд 14

Слайд 15

The Program Segment Prefix (PSP) is a data structure used in

The Program Segment Prefix (PSP) is a data structure used in DOS in systems

to store the state of a program and important service information. It’s elaborated by DOS automatically during program loading process.

9. What is for Program Prefix segment is used in Assembly?