Professional Documents
Culture Documents
Programming Models
Assembler Directives
• Assembler directives : Directions to the
assembler ,not instruction for the 8086
• Directions : (hints from the programmer given to
assembler using predefined alphabetical string)
• the required storage for a particular
constant or variable,
• Logical name of the segments,
• Types of different routines and modules
• End of file etc
• Machine language - Instructions are written in binary
codes which use 0 and 1
• Assembler Directives
• A label :can be placed at the beginning of a
statement. During assembly, the label is
assigned the current value of the active
location counter and serves as an instruction
operand.
Define Byte
• Module 1 : public
• Module 2 : EXTERN( informs that’s its already
defined in some other module)( Accompanied
by segment and ends)
Example
• MODULE 1 SEGMENT
• PUBLIC FACTORIAL FAR
• MODULE 1 ENDS
• MODULE 2 SEGMENT
• EXTERN FACTORIAL FAR
MODULE 2 ENDS
•
• LENGTH :LENGTH is an operator, which tells the assembler to
determine the number of elements in some named data item,
such as a string or an array.
• ORG 100h
Programming models
.MODEL
TINY: Code and data fit within a single 64K segment.
Memory references are NEAR.
SMALL: Code and data have 64K segment individually.
Memory references are NEAR.
MEDIUM: Code may be bigger than 64K but data can only be
64K. References to code are FAR and data is NEAR.
Programming models
COMPACT: Code must fit within 64K but the data may
exceed 64K. Code references are NEAR and data is FAR. No
data array can exceed 64K.
LARGE: Both data and code can be larger than 64K. All
references are FAR. No data array can exceed 64K.
HUGE: Both data and code can be larger than 64K. All
references are FAR. Data array can exceed 64K. Pointers to
elements within an array are far.