0% found this document useful (0 votes)
78 views7 pages

MIC 2021-22 - Class Test II - Model Ans - 240520 - 101346

Class test ipms

Uploaded by

Durgesh Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views7 pages

MIC 2021-22 - Class Test II - Model Ans - 240520 - 101346

Class test ipms

Uploaded by

Durgesh Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Sinhgad Technical Education Society’s

Sou.Venutai Chavan Polytechnic, Pune-41


Department of Computer Technology
Academic Year 2021-22
MSBTE CLASS TEST II
Year & Sem: 2nd& 4I Max. Marks: 20 Date: 26/05/2022
Course: Microprocessor (22415) Duration: 1 Hour
Course Outcomes:
c. Use instructions for different addressing modes.
d. Develop an assembly language program using assembler.
e. Develop an assembly language program using procedures, macros and modular programming
approach.

Q. Sub. Answer Marks


No Q.No
Q.1. Attempt any FOUR 8 Marks
a) State the use of REP in string related instructions. 2M
Ans REP: REP is a prefix which is written before one of the string instructions. It will cause
During length counter CX to be decremented and the string instruction to be repeated until 2M
CX becomes 0. (1M each)
Two more prefix. REPE/REPZ: Repeat if Equal /Repeat if Zero. It will cause string
instructions to be repeated as long as the compared by words Are equal and CX≠0.
REPNE/REPNZ: Repeat if not equal/Repeat if not zero. It repeats the strings instructions as
long as compared bytes or words are not equal And CX≠0.
Example: REP MOVSB
b) Write an ALP to divide two 8 bit signed numbers. 2M
Ans .model small
.data
2M
dividend dw 0123h
divisor db 12h (1/2 for
quo db 0
each)
rem db 0
.code
mov ax, @data ; Initialize data segment
mov ds, ax
mov ax, dividend ; Divide word bit by byte
idiv divisor
mov quo, al ; Store Quotient
mov rem, ah ; Store Remainder
ends ; Stop
end
c) Write an ALP to count number of “1” in 16 bit number. 2M
Ans .model small
.data
num dw 0101h
ones db 0 2M
.code
Program -
mov ax, @data
mov ds, ax 2M
mov cx, 16
mov ax, num
up: ror ax, 1
jnc dn
inc ones
mov bl, ones
dn: loop up
ends
end
d) What is the difference between Near and Far procedure. 2M
Ans 2M
Each
Point: 1/2
M (any 4
Points)

e) What do you mean by recursive procedure? 2M


Ans Procedure: 2M
A procedure is a set of code to be executed several times in a program, and called whenever (1M for
required. A repeated group of instruction in a program can be organized as subprogram. The
subprograms are called as subroutine or procedures in assembly language programming Definition
which allows reuse of program code. A procedure is a set of the program statements that can &1M for
be processed independently.
Recursive procedure: syntax)
A recursive procedure is procedure which calls itself. This results in the procedure call
to be generated from within the procedures again and again.
The recursive procedures keep on executing until the termination condition is reached.
The recursive procedures are very effective to use and to implement but they take a large
amount of stack space and the linking of the procedure within the procedure takes more
time as well as puts extra load on the processor.

f) Describe any two Rotate instructions with example. 2M


Ans ROL Instruction: ROL destination, count.

This Rotate Instruction in 8086 with example all bits in a specified byte or word to the left
some number of bit positions. MSB is placed as a new LSB and a new CF. 2M

Diagram shows ROL instruction for byte rotation. (1M for


each)
The destination can be a byte or a word. It can be in a register or in a memory location. The
number of shifts is indicated by count. If number of shifts required is one you can place 1 in
the count position. If number of shifts is greater than 1 then shift count must be loaded in CL
register and CL must be placed in the count position of the instruction.

ROR Instruction : ROR destination, count.

This Rotate Instruction in 8086 with example all bits in a specified byte or word to the left
some number of bit positions. LSB is placed as a new MSB and a new CF.

The destination can be a byte or a word. It can be in a register or in a memory location. The
number of shifts is indicated by count. If number of shifts required is one, you can place 1 in
the count position. If numbers of shifts are greater than 1 then shift count must be loaded in
CL register and CL must be placed in the count position of the instruction.

Diagram shows ROR instruction for byte rotation.

Q.2 Attempt any FOUR 12M


a) Write an ALP to perform block transfer operation of 5 numbers. 04M
Ans

4M
(Correct
program:
4 MFor
basic logic
may give
1-2 M)

b) Describe the programming model of 8086. 04M


Ans Programming model of 8086:

4M for
correct
Program
& Logic

OR
c) Give the difference between Inter segment & Intra segment CALL. 04M
Ans Sr. No Inter segment CALL Intra segment CALL
1 It is also called Far procedure call It is also called Near procedure call 4M

2 A far procedure refers to a procedure A near procedure refers to a procedure Correct


which is in the different code segment which is in the same code segment program:
from that of the call instruction. from that of the call instruction.
4 M For
3 This procedure call replaces the old This procedure call replaces the old IP
CS:IP pairs with new CS:IP pairs. with new IP. basic logic
4 The value of the old CS:IP pairs are The value of old IP is pushed on to the
may give
pushed on to the stack SP=SP-2 ;Save stack. SP=SP-2 ;Save IP on
CS on stack SP=SP-2 ;Save IP (new stack(address of procedure). 1-2 M
offset address of called procedure).

5 More stack locations are required. Less stack locations are required.
6 Example :- Call FAR PTR Delay Example :- Call Delay
d) Write an ALP for concatenation of two strings. Draw flowchart & assume suitabledata. 04M
Ans

4M
(Program
2M
flowchart
2 M)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy