For Upload PDF
For Upload PDF
(a)
Destination Source
Accumulator Reg16
Memory Register
Register Register
(b)
Fig.14.1: (a) Exchange data transfer instruction (b) Allowed operands
The content of BX represents the offset of the starting address of the look up table
from the beginning of the current data segment while the content of AL represents the
offset of the element which is to be accessed from the beginning of the look up table.
As an example, let DS = 0300 H, BX = 1234 H and AL = 05 H.
Hence, PA = 03000 H + 1234 H + 05 H = 04239 H
228 Understanding 8085/8086 Microprocessors and Peripheral ICs through Questions and Answers
Thus, execution of XLAT would put the content of 04239 H into AL register.
Conceptually, the content of 04239 H in EBCDIC should be the same as the ASCII
character equivalent of 05 H.
10. Explain the instruction LEA, LDS and LES.
Ans. These three instructions are explained in Fig.14.3. These instructions stand for load
register with effective address (LEA), load register and data segment register (LDS) and
load register and extra segment register (LES) respectively.
Mnemonic Meaning Format Operation Flags affected
Subtraction
SUB Subtract byte or word
SBB Subtract byte or word with borrow
DEC Decrement byte or word by 1
NEG Negate byte or word
AAS ASCII adjust for subtraction
DAS Decimal adjust for subtraction
Multiplication
DIV Divide byte or word unsigned
IDIV Integer divide byte or word
AAD ASCII adjust for division
CBW Convert byte to word
CWD Convert word to double word
12. Show the allowed operands for the instruction ADD, ADC and INC.
Ans. The allowed operands for ADD and ADC are shown in Fig.14.5 (a) and for INC it is shown
in Fig.14.5 (b).
Destination Source
Register Register
Register Memory
Destination
Memory Register
Register Immediate Reg 16
Memory Immediate Reg 8
Accumulator Immediate Memory
(b)
(a)
Fig.14.5: (a) Allowed operands for ADD and ADC
(b) Allowed operands for INC
13. Show the different subtraction arithmetic instructions. Also show the allowed
operands for (a) SUB and SBB (b) DEC and (c) NEG instructions.
Ans. The different subtraction arithmetic instructions and the allowed operands, for the
different instructions are shown in Fig. 14.6 (a), (b), (c) and (d) respectively.
Mnemonic Meaning Format Operation Flags affected
SUB Subtract SUB D,S (D)–(S)→(D) OF, SF, ZF, AF, PF, CF
Borrow→(CF)
SBB Subtract with borrow SBB D,S (D)–(S)–(CF)→(D ) OF, SF, ZF, AF, PF, CF
DEC Decrement by 1 DEC D (D)–1→(D) OF, SF, ZF, AF, PF
NEG Negate NEG D 0–(D)→(D) OF, SF, ZF, AF, PF, CF
1→(CF)
DAS Decimal adjust for DAS SF, ZF, AF, PF, CF
subtraction OF undefined
AAS AASCII adjust for AAS AF, CF, OF, SF, ZF,
subtraction PF undefined
(a)
Destination Source
Register Register
Register Memory
Memory Register Destination Destination
Accumulator Immediate Reg16 Register
Register Immediate Reg 8 Memory
Memory Immediate Memory
(b) (c) (d)
Fig.14.6: (a) Subtraction arithmetic operations
(b) Allowed operands for SUB and SBB instructions
(c) Allowed operands for DEC instruction
(d) Allowed operands for NEG instruction
230 Understanding 8085/8086 Microprocessors and Peripheral ICs through Questions and Answers
14. Show the different multiplication and division instructions and also the
allowed operands.
Ans. The different multiplication and division instructions and also the allowed operands are
shown in Fig.14.7 (a) and (b) respectively.
(a)
Source
Reg 8
Reg 16
Mem 8
Mem 16
(b)
Fig.14.7: (a) Multiplication and division instructions (b) Allowed operands.
15. Show the different logic instructions and also the allowed operands for
(a) AND, OR and XOR (b) NOT instructions.
Ans. The different logic instructions as also the allowed operands for different instructions are
shown in Fig.14.8 (a), (b) and (c) respectively.