Assembler Directive in Microprocesser 8086
Assembler Directive in Microprocesser 8086
❑ They act during the assembly of a program and do not generate any
executable machine code.
Example: ALIGN 8 ; This forces the assembler to align the next segment
; at an address that is divisible by 8. The assembler
; fills the unused bytes with 0 for data and NOP
instructions for code.
❑ The 8086, at any time, can directly address four physical segments
which include a code segment, a data segment, a stack segment and an
extra segment.
❑ The 8086 may contain a number of logical segments.
❑ The ASSUME directive assigns a logical segment to a physical segment
at any given time.
❑ ASSUME directive tells the assemble what addresses will be in the
segment registers at execution time.
END:
❑ The END directive is put after the last statement of a program to tell
the assembler that this is the end of the program module.
❑ The assembler ignores any statement after an END directive.
TITLE:
❑ The TITLE directive help to control the format of listing of an assembled
program.
❑ TITLE directive causes a title for a program to print on line 2 of each
page of the program listing. Maximum 60 characters are allowed as title.
Format: TITLE text
❑ When the assembler reads the instruction INC [BX], for example, it will not know
whether to increment the byte pointed to by BX.
❑ We use the PTR operator to clarify how we want the assembler to code the instruction.
The statement INC BYTE PTR [BX] tells the assembler that we want to increment the
byte pointed to by BX. The statement INC WORD PTR [BX] tells the assembler that we
want to increment the word pointed to by BX.
❑ The PTR operator assigns the type specified before PTR to the variable specified after
PTR.
❑ We can also use the PTR operator to clarify our intentions when we use indirect Jump
instructions.
❑ The statement JMP [BX], for example, does not tell the assembler whether to code the
instruction for a near jump. If we want to do a near jump, we write the instruction as
JMP WORD PTR [BX]. If we want to do a far jump, we write the instruction as JMP
DWORD PTR [BX].
As you type in your program, the editor stores the ASCII codes
for the letters and numbers in successive RAM locations.
When you have typed in all your program, you then save the
file on the hard disk. This file is called source file and the
extension is .asm.
❑ The linker produces a link file which contains the binary codes for all
the combined modules. The linker also produces a link map file which
contains the address information about the linked files (.exe).
Locator
❑ A locator is a program used to assign the specific address of where the
segments of object code are to be loaded into memory.
❑ The debugger allows you to look at the contents of registers and memory
locations after your program runs.
❑ It allows you to change the contents of registers and memory locations and re-
run the program.
❑ Some debuggers allow you to stop execution after each instruction so that you
can check or alter after each register contents.
❑ A debugger also allows you to set a breakpoint at any point in your program.
If you insert a breakpoint at any point in your program, the debugger will run
the program up to the instruction where you put the breakpoint and then stop
the execution.