Está en la página 1de 2

EC6504: Microprocessor and Microcontroller

Assignment Unit 1
Question Set: 2
Monday Even & Friday Odd Batch of Students
(3122 13 106 104, 105, 106, 110, 111, 112, 116, 117, 118, 122, 123, 312, 316, 317, 318, 322, 323, 324) and
(3122 13 106 062, 063, 064, 068, 069, 070, 074, 076, 077, 082, 083, 085, 089, 090, 091, 095, 096, 097)

1 Assume that the state of the Intel 8086 microprocessors registers and memory just prior to the
execution of the each of the instructions [ (a) to (k) ] is as follows.
(AX) = 5555 H; (BX) = 0010 H; (CX) = 0010 H; (DX) = AAAA H;
(SI) = 0100 H; (DI) = 0200 H;
(DS:0100 H) = 0F H; (DS:0101 H) = F0 H; (DS:0110 H) = 00 H; (DS:0111 H) = FF H;
(DS:0200 H) = 30 H; (DS:0201 H) = 00 H; (DS:0210 H) = AA H; (DS:0211 H) = AA H;
(DS:0220 H) = 55 H; (DS:0221 H) = 55 H; (DS:0300 H) = AA H; (DS:0301 H) = 55 H.

i. AND BYTE PTR [0300 H], 0F H


ii. AND DX, [SI]
iii. OR [BX+DI], AX
iv. OR BYTE PTR [BX] [DI] 10 H, F0 H
v. XOR AX, [SI+BX]
vi. NOT BYTE PTR [0300 H]
vii. NOT WORD PTR [BX+DI]

What result is produced in the destination operand by each of the instructions


[ (a) through (g) ]?
2 Assume that the state of the Intel 8086 microprocessors registers and memory just prior to the
execution of the each of the instructions [ (a) to (f) ] is as follows.
(AX) = 0000 H; (BX) = 0010 H; (CX) = 0105 H; (DX) = 1111 H;
(SI) = 0100 H; (DI) = 0200 H; (CF) = 1
(DS:0100 H) = 0F H; (DS:0200 H) = 22 H; (DS:0201 H) = 44 H; (DS:0210 H) = 55 H;
(DS:0211 H) = AA H; (DS:0220 H) = AA H; (DS:0221 H) = 55 H; (DS:0400 H) = AA H; (DS:0401 H) = 55 H.

(a) ROR DX, CL


(b) RCL BYTE PTR [0400 H], CL
(c) ROR BYTE PTR [DI], 1
(d) ROR BYTE PTR [DI+BX], CL
(e) RCR WORD PTR [BX+DI], 1
(f) RCR WORD PTR [BX] [DI] + 10 H, CL

What result is produced in the destination operand by each of the instructions


[ (a) through (f) ]?

EC6504: Microprocessor and Microcontroller / Assignment Unit 1 / Question Set: 2 Page 1 of 2


3 What is the state of the 8086s flags after executing the instructions in parts (a) through (c).
CMP [0100H], AL
CMP AX, [SI]
CMP WORD PTR [DI], 1234H
Assume that the following initial conditions exists before executing the instructions.
(AX) = 8001 H; (SI) = 0200 H; (DI) = 0300 H;
(DS:0100 H) = F0H; (DS:0200 H) = F0H; (DS:0201 H) = 01H; (DS:0300 H) = 34 H; (DS:0301 H) = 12 H.
4 If the state of the 8086 is follows before executing each of the instructions given below, to what
address is program control passed?
(CS) = 1075 H; (IP) = 0300 H; (BX) = 0100; (SI) = 0100 H;
(DS:0100 H) = 00H; (DS:0101 H) = 10H; (DS:0200 H) = 00H; (DS:0201 H) = 01H; (DS:0202 H) = 00H;
(DS:0203 H) = 10H
CALL 1000H
CALL WORD PTR [0100H]
CALL DWORD PTR [BX + SI]
5 Encode the following instructions:
ADD AX, DX
MOV [DI], DX
MOV DL, [BX]+10H
PUSH DS
6 Two code-conversion tables starting with offsets TABL1 and TABL2 in the current data segment are to
be accessed. Write an instruction sequence that initializes the needed registers and then replaces the
contents of memory locations MEM1 and MEM2 (offsets in the current data segment) by the
equivalent converted codes from the respective code-conversion tables.
7 Two numbers N1 and N2 are stored in memory. Write an 8086 ALP to perform the following operations
and store the results back in same memory locations.
N1 = (N1 64) AND 0F H
N2 = (N2 / 16) XOR 0F H
Do not use multiplication and division instruction.
8 Write an 8086 ALP to check whether the given string is palindrome or not.
9 Write an 8086 ALP to get an 2 digits input from the keyboard for using BIOS Interrupts and convert
that input into a hexadecimal number
10 Write an 8086 ALP to multiply a constant value (byte) to a sequence of data from 1 to N stored in
memory stored in consecutive memory locations and store the results in another set of consecutive
memory locations. Use string instructions.
11 Write an ALP using 8086 instructions to find the square of a number.
12 Write an 8086 program to count up from 0000 H to an N value that the program signals. All numbers
are stored as double words.

EC6504: Microprocessor and Microcontroller / Assignment Unit 1 / Question Set: 2 Page 2 of 2