M2 Flashcards
specifies the memory size assigned to each of the different parts or segments of a program
memory model
there exist different memory models for the
8086 processor
this specifies the size of the memory the program needs
.MODEL Directive
memory model directive
Based on this directive, the assembler assigns the required amount of memory to data and code.
.MODEL Directive
memory model directive
what are the segments
each one of the segments. in a program, is called a
stack, data, and code
logical segment
depending on the model used, segments may be
one or in different physical segments
here, segments are declared using the .MODEL directive
MASM 6.X
This directive is placed at the very beginning of the program, or after the optional title directive
.MODEL Directive
memory model directive
in this model, both code and data occupy one physical segment
TINY Model
In the TINY model both code and data occupy one physical segment. Therefore, all procedures and variables are by default addressed as X, by pointing at their offsets in the segment.
NEAR
On assembling and linking a source file, the tiny model automatically generates a X file, which is smaller in size than an Y file.
com
exe
In this model, all code is placed in one physical segment and all data in another physical segment.
SMALL
In this model, all procedures and variables are addressed as NEAR by pointing to their offsets only.
SMALL
In this model, all elements of code are placed into one physical segment. However, each element of data can be placed by default into its own physical segment.
COMPACT
In the compact model, all code elements (procedures) are addressed as X and data elements (variables) are addressed as Y
NEAR
FAR
the model opposite of the compact model
medium
In this model, data elements are treated as NEAR and code elements are addressed as FAR.
medium
In this model, both code elements (procedures) and data elements (variables) are put in different physical segments.
LARGE
In the large model, pocedures and variables are addressed as X by pointing at both the segment and offset addresses that contain those elements.
FAR
no data array can have a size that exceeds one physical segment
true
This model is similar to the LARGE model with the exception that a data array may have a size that exceeds one physical segment
HUGE
For the LARGE model, the largest arrays size can not exceed X
64 KB
For the HUGE model, an array may have a size X than 64 KB and hence can span more than one
greater
The X and X are the major factors in determining the choice of an appropriate model.
amount of data that has to be manipulated
code that needs to be written
For a small fast program that operates on small quantities of data, the X models are the most suitable ones
SMALL or TINY
difference of small and tiny model
tiny model generates a COM module
small model generates an EXE module
what module does not allow references to be used
COM
For very long programs that require more than one code segment and operate on large amounts of data which would require more than one data segment, the X models are most appropriate.
LARGE and HUGE