Question Bank CAT 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Question bank

Programme : B.Tech – CSE Semester : FS 2020-21


Course : Microprocessor and Interfacing Code : CSE2006
Class Nbr : CH2020215000985
Faculty : Dr.E.Sathish Slot : D2

1. The contents of different registers are given below. Offset = 6000H [AX]- 1040H, [BX]- 2023H, [SI]-
3011H, [DI]- 4000H, [BP]- 5000H, [SP]- 6000H, [CS]- 0000H, [DS]- 1000H, [SS]- 2000H, [IP]- 7000H.
Determine the type of addressing mode and effective address for the below instructions
MOV AX, 5000H
MOV AX, 5000H [BX]
MOV AX, [CX] [SI]
MOV AX, 5000H [BX] [SI]

2. i) If BX=0101h, DI=10A5h, DS=2500h and DS is used as segment register. Explain and calculate
effective address and physical address for following addressing modes. Also identify addressing
mode used in the instruction
MOV DL,[BX]+0BA2h
MOV AX,[BX][DI]+0004h (4 marks)
ii) AL=22 BCD, CL=31 BCD. Perform the addition and subtraction of above two registers value and
obtain a valid BCD using suitable instruction (6 marks)

3. i) Justify the statements, 8086 does not have on-chip clock generation circuit, 8086 has maximum
clock cycle of 5 MHz (4 Marks)
ii) AL=44 BCD, CL=53 BCD. Perform the addition and subtraction of above two registers value and
obtain a valid BCD using suitable instruction (6 marks)

4. Find the value AX at the end of execution and list all flags status at each step of execution.
Describe the bit wise operations in detail.
CODE SEGMENT
ASSUME CS:CODE
START:
MOV CL,02H
MOV AX,105AH
SHR AX,CL
SAL AX,CL
CLC
ROR AX,02H
CODE ENDs
END START
5. Find the value AX and status of all flags at the end of execution. Describe the bit wise operations in
detail.
CODE SEGMENT
ASSUME CS:CODE
START:
MOV AX 0123H
MOV BX 0423H
AND AX, 0005H
AND AX, BX
OR AX,BX
NOT AX
TEST AX,BX
STC
CODE ENDs
END START

6. Find the value AX at the end of execution and list all flags status at each step of execution.
Describe the bit wise operations in detail.
CODE SEGMENT
ASSUME CS:CODE
START:
MOV CL,02H
MOV AX,105AH
SHL AX,CL
SAL AX,CL
CLC
RCR AX,02H
CODE ENDS
END START

7. Identify the errors in the program for finding permutation, provide valid reasons for the error and
debug it with description for the mnemonics.
Identification of Errors (3 marks)
Reasons (3 marks)
Debugging with description (4 marks)
DATA SEGMENT
R DW 03H
N DB 06H
DATA END
CODE SEGMENT
ASSUME CS:DATA, DS:CODE
START:
LEA [SI],R
MOV CX,N
MOV 01H, AX
MOV BL,AX
LABLE1:
INC BL
MUL BL
CMP CX, BL
JNZ LABLE1
SUB CX,SI
MOV BX,00H
INC [SI]
INC [SI]
MOV [SI],[AX]
MOV 01H, BL
LABEL2:
INC BL
MUL BL
CMP BL, CX
JNZ LABEL2
MOV BL,AX
MOV AX,[SI]
DIV BL
CODE END
ENDS START

8. Identify the errors in the program for displaying Fibonacci series of n=9, provide valid reasons for
the error and debug it with description for the mnemonics.
Identification of Errors (3 marks)
Reasons (3 marks)
Debugging with description (4 marks)

DATA SEGMENT
N DW 09H
FIB DB DUP(0)
DATA END
CODE SEGMENT
ASSUME CS:DATA, DS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV 00H, BL
MOV CH,N
MOV 01H,CL
MOV 00H, AL
LEA [SI],FIB
MOV 00H, [SI]
INC SI
L1:
ADD CL,BL
MOV [SI],[CL]
INC SI
MOV CL,BL
MOV BL,SI-1
DEC CH
JZ L1
CODE END
ENDS START
9. Identify the errors in the program of adding two arrays, provide valid reasons for the error and
debug it with description for the mnemonics.
Identification of Errors (3 marks)
Reasons and description (3 marks)
Debugging (4 marks)

DATA SEGMENT
NUM1 DB 0336H,0055H,0127H,0342H
NUM2 DB 0138H,0241H,0229H,0439H
RESULT DB 5 DUP (?)
DATA END
CODE SEGMENT
ASSUME CS:DATA, DS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA [SI],NUM1
LEA [DI],NUM2
LEA [BX],RESULT
MOV 05,CX
LOOP1:
MOV [AL],[SI]
ADD AL,[DI]
MOV [BX],AL
INC BX
INC SI
INC DI
LOOP LOOP1
HLT
CODE END
ENDS START

10. i) Compute the effective address for 2000:5000 (3marks)


ii) Explain the usage of Arithmetic and Logical instructions in ALP with example (7 marks)

11. i) Compute the effective address for 1000:[5000+3000] (5marks)


ii)Explain the usage of Branch and Loop instructions in ALP with example (7 marks)

12.i) Compute the effective address for 3000:[2000+5000+9000] (5marks)


ii)Explain the usage of Shift and Rotate instructions in ALP with example (7 marks)

13. Once there were two friends in a village. One friend who is named Ram have 30 apples and the
other one named Raj have 20 bananas in their bags. They decided to offer all the fruits in their bag
to a near-by orphanage with 10 kids. Write an algorithm and ALP to decide how many fruits to be
shared for a single person in that orphanage. Provide description for the mnemonics.

14. Once there were three friends in a village. One friend who is named Ram have 30 apples and the
other one named Raj have 20 bananas in their bags. The third friend named Vijay ate two bananas
and three apples from his friends. They decided to offer all the remaining fruits in their bag to a
near-by orphanage with 9 kids. Write an algorithm and ALP to decide how many Apples to be shared
for a single person in that orphanage. Provide description for the mnemonics.

15. Once there were three friends in a village. One friend who is named Ram have 50 apples and the
other one named Raj have 38 bananas in their bags. The third friend named Vijay ate two bananas
and three apples from his friends. They decided to offer all the remaining fruits in their bag to a
near-by orphanage with 18 kids. Write an algorithm and ALP to decide how many Bananas to be
shared for a single person in that orphanage. Provide description for the mnemonics.

16. Write an 8086 ALP which will input your name and register number from the keyboard. If the
user is you, it should display - The username is valid, else it will output Invalid user name. Provide
description for the mnemonics.

17. Write an 8086 ALP which will input your register number from the keyboard. Add all the digits in
your register number and make its as single number (ranging from 0 to 9) and find the factorial of it.
Provide description for the mnemonics.

18. Smitha participated in a competition for doubling the amount of Rs. 20 and she won the same.
She also received five bonus points where each point carries one rupee. Write an algorithm and ALP
to compute the total money she got in competition and convert it to HexaDecimal. Provide
description for the mnemonics.

You might also like