0
32kviews
Write short notes on assembler directives
1 Answer
0
235views
  1. Assembly language consists of two types of statements viz.
  2. Executable statements- These are the statements to be executed by the processor. It consists of the entire instruction set of 8086.
  3. Assembler directives- These are the statements that direct the assembler to do something. As the name says, it directs the assembler to do a task.
  4. The specialty of these statements is that they are effective only during the assembly of a program but they do not generate any code that is machine executable.
  5. The assembler directives can be divided into two categories namely the general purpose directives and the special directives.
  6. They are classified into the following categories based on the function performed by them-
  7. Simplified segment directives
  8. Data allocation directives
  9. Segment directives
  10. Macros related directives
  11. Code label directives
  12. Scope directives
  13. Listing control directives
  14. Miscellaneous directives
  15. .CODE- This assembler directive indicates the beginning of the code segment. Its format is as follows: .CODE [name] The name in this format is optional.
  16. .DATA- This directive indicates the beginning of the data segment.
  17. .MODEL- This directive is used for selecting a standard memory model for the assembly language program. Each memory model has various limitations depending on the maximum space available for code and data.
  18. .STACK- This directive is used for defining the stack. Its format is as follows: .STACK [size]
  19. Define Byte [DB]- This directive defines the byte type variable.
  20. Define Word [DW]- The DW directive defines items that are one word (two bytes) in length.
  21. Define Double word [DD]- It defines the data items that are a double word (four bytes) in length.
  22. Define Quad word [DQ]- This directive is used to tell the assembler to declare variable 4 words in length or to reserve 4 words of storage in memory.
  23. Define Ten bytes [DT]- It is used to define the data items that are 10 bytes long.
  24. ASSUME- The directive is used for telling the assembler the name of the logical segment which should be used.
  25. END- This is placed at the end of a source and it acts as the last statement of a program. This is because the END directive terminates the entire program.
  26. ALIGN- This directive will tell the assembler to align the next instruction on an address which corresponds to the given value.
  27. LABEL- This directive assigns name to the current value of the location counter.
  28. INCLUDE- This directive is used to tell the assembler to insert a block of source code from the named file into the current source module. This shortens the source code. Its format is: INCLUDE path: file name
Please log in to add an answer.