Important Assembler Directives of the Microprocessor Data declaration directives: DB, DW, DD, DQ, DT ASSUME END directives EQU. The words defined in this section are directions to the assembler, not instructions for the Richa Upadhyay Prabhu. Microprocessors. Introduction To Segmentation: The microprocessor has 20 bit . The DW directive is used to tell the assembler to define a variable of type.
|Published (Last):||28 June 2008|
|PDF File Size:||5.3 Mb|
|ePub File Size:||15.75 Mb|
|Price:||Free* [*Free Regsitration Required]|
Same is the case with stack and extra segments also, which are only different type of data storage facilities. The general format for ENDP directive is: In many cases the program is optimized and kept unaltered for the specific application. The general format for the EQU directive is:.
The memory locations are to be initialized with the values 32, 42, 59, 67 and It also finds out codes of the instructions from the instruction machine, code database and the program data. The directive ENDP informs assembler the end of a procedure.
The directive DQ defines a quadword- type variable. A carriage return is used after the END directive. The instructions are translated to machine codes by the assembler whereas the directives are not translated to machine codes.
Each module is individually assembled, tested, and debugged. This is called the base mlcroprocessor.
Each time the assembler finds the given name in the program, it replaces the name with the value or symbol which has already been equated with that name. This directive informs the assembler to reserve two bytes one word of consecutive memory locations for the variable named SUM and initialize it with the value If there is only one value, four bytes of consecutive memory locations are reserved.
The names, procedures and labels declared as external in one microprocesso module must be declared public using PUBLIC directive in the program module in which they have been defined. The low word, H, will be put in memory at a lower address than the high word. Learn How to Order Essay Online. The above directive informs assembler to reserve four bytes of memory locations for the variable named NUMBER and initialize with the number The above directive informs the assembler that the name of the data segment is DATA.
Hence, the two bytes of memory space contain H. The defined variable may have one or more initial values in the directive statement. This directive informs the assembler to reserve the number of bytes of memory space equal to the number of characters in the string named MESSAGE, and initialize the memory locations with ASCII codes of the djrectives characters.
The directive DT defines a variable of ten bytes.
the use of assembler directives in microprocessor
Thus the basic task of an assembler is to generate the object module and prepare the loading and linking information. The general format is: Therefore, the programmer should use END directive at the very end of his program module.
The directive ENDM is used to inform assembler that this is the end of a macro. The assembler will then put this information in the object code file so that the linker can connect the two modules together. A procedure may be an independent program module to give certain result or the required value to the calling program. The directive DW defines a word -type variable. These instructions are instructions to the assembler, linker and loader. It is the task of the assembler designer to select the suitable strings for using them as directives,pseudo operands or reserved words and decides syntax.
A procedure is given a name i. The ASSUME directives is used to inform the assembler the names of the logical segments, which are to be assigned to the different segments used in an assembly language program. The stack segment register SS holds the starting address of the stack segment allotted by the operating system. The type of label is to be specified.
Assembler Directives & Macros
This directive informs assembler to reserve five bytes of consecutive memory space for the variable named ARRAY. The type FAR indicates that the procedure to be called is in some other segment of memory.
The assembler prepares the relocation and linkages information subroutine, ISR for loader. If type is not specified, the assembler assumes it NEAR. When all the modules are working correctly, their object code files are linked together to form the complete program. Memory locations are initialized with ,, , and The general formula is: Procedure for assembling a program Directiges a program proceeds statement by statement micdoprocessor.
It stores addresses and data of the subroutines, saves the contents a specified register or memory locations after PUSH instruction, etc. The directive DB a byte type variable. Abstract This term paper includes the use of assembler directives in microprocessor and the various assembler directives used in Intel microprocessorits format with various examples. In an assembly language program, each segment is given a name by the programmer. If there is one value, two-bytes of memory space are reserved.
The assembler directives control organization of the program and provide necessary information to the assembler to understand assembly language programs to generate machine codes. The above directive tells the assembler that the name of the code segment is CODE. Its general format is:. Segmentation helps in the following way.
They generate and store information in the memory. Normally the data is variable.