You are on page 1of 2

MICROPROCESSER

TUTORIAL 3
1. Explain XLAT instruction.
XLAT translate: Instruction is used to find out the codes in case of code
conversion problems, using look up table technology.
Suppose, a hexadecimal keyboard is interfaced with the 8086. Whenever the
key is pressed the code of the key is returned in AL. For displaying on the
seven segment display, it is required that the 7-segment code corresponding
to the key pressed is found out and sent to the display port. This translation
from code of the key pressed to the corresponding 7-segment code is
performed by XLAT instruction. For this purpose the look up table is stored in
the BX register. The code when the key pressed is stored in the AL register
when the XLAT instruction is executed the equivalent 7-segment code is
looked up from the BX table and stored in the AL, replacing the key code with
the 7-segment code.
2. Explain LDS and LES.
LDS/LES Load pointer to DS/ES: This instruction loads the DS or ES register
and the specified destination register with the content of memory location
specified as source in the instruction.
LDS BX,5000H
BX

15
Y

Y 7 X0 X
DS M
M X NX N
Y Y
M M
3. Explain
N N with examples LAHF and SAHF instruction
LAHF
Load AH from Lower Byte of flag: This instruction
loads the AH register with the lower byte of the flag. This commands may be
used to observe the status of all the condition codes flag at a time.
SAHF Store AH to lower Byte of the Flag register: This instruction sets
or resets the conditional code flags in the lower bytes of the flag register with
corresponding bit position in AH. If a bit in AH is high, the flag corresponding
to this bit position is set, else reset.
4. Explain with examples PUSHF and POPF instruction.
PUSHF: The flag instruction pushes the flag register on to the stack; first the
upper byte and then the lower byte is pushed on to the stack. The SP is
decremented twice. The general operation of this instruction is similar to the
PUSH operation.
POPF: The instruction loads the flag register completely from the word
contents of memory location currently addressed by SP and SS. The SP is
incremented by 2 for each pop.

Part B
i.
ii.
iii.
iv.
v.
vi.
vii.

LEA ES,56H[SI]
LEA BX,[AX]
LEA BX,1122H
LEA BX,[11OOH]
LEA BX,DS:1100H
LEA IP,DS:1100H
LEA IP,[1100H]

:invalid operand
:valued
:invalid operand
:invalid name
:invalid operand
:invalid operand

You might also like