Featured

    Featured Posts

Write short notes on directives and operators.


Assembler directives : These are the statements that direct the assembler to do something. As the name suggest, it direct the assembler to do a task.
  • 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.
  • We can divide the assembler directives into two categories namely the general purpose directives and the special directives.

They are classified into the following categories namely the general purpose directives and the special directives.
  1. Simplified segment directives
  2. Macros related directives.
  3. Segment directives.
  4. Data allocation directives.
  5. Code label directives.
  6. Scope directives.
  7. Listing control directives.
  8. Miscellaneous directives.
Operators : Various operators are as follows :
  1. Length : It is operator which tells the assembler to determine the number of elements in some named data item such as a string or array. Example, MOV BX, LENGTH STRING 1; Loads the length string in BX.
  2. OFFSET : It is an operator which tells the assembler to determine the off set or displacement of a named data item (variable) from the start of the segment which contais. Example, MOV AX, OFFSET MESI, : Loads the offset of variable, MESI in AX register.
  3. Short : A short is an operator. It tells the assembler that only 1 byte displacement is needed to code a jump instruction. If the jump destination is after the jump instruction in the program, the assembler will automatically reserve 2 byte for the displacement. Using the short operator saves 1 byte of memory by telling the assembler that it only needs to reserve 1 byte for this particular jump. The short operator should be used only when the destination is fit the range of 128 bytes of +127 bytes from the address of the instructions after the jump. Example, IMP SHORT NEAR-LABEL
  4. Type : It is an operator which tells assembler to determine the type of specified variable. Assembler determines the type of specified variable in number of bytes. For byte types variable the assembler gives a value of 1. For word type variable the assembler gives a value 2 and for doubles word type variable  the assembler gives a value of 4.

Post a Comment

www.CodeNirvana.in

www.posthatke.com. Powered by Blogger.

Google+ Followers

Copyright © www.posthatke.com | Blogger Templates | Designed By posthatke.com