Professional Documents
Culture Documents
Paper I - Software
Visual Basic
Program No 1 : Program to calculate Area of circle and Rectangle
Text4.Text = ""
Text5.Text = ""
End Sub
Private Sub exit_Click()
End
End Sub
Private Sub rectangle_Click()
Shape2.Visible = True
Label2.Visible = True
Label3.Visible = True
Text3.Visible = True
Text4.Visible = True
Text5.Visible = True
area_rect.Visible = True
Shape1.Visible = False
Label1.Visible = False
Text1.Visible = False
Text2.Visible = False
area_circle.Visible = False
End Sub
End Sub
Private Sub cmdsq_Click( )
Dim squa As Double
squa = Val(Text1.Text) * Val(Text1.Text)
Text2.Text = squa
End Sub
End If
If IsNumeric(tele.Text) <> True Then
MsgBox ("Enter valid Telephone number")
tele.Text = ""
tele.SetFocus
a=1
End If
If a = 0 Then
MsgBox ("All fields are valid")
MsgBox ("Thank you")
End If
End Sub
C++
Program No 1 : Calculate area and circumference of circle using class
#include<iostream.h>
#include<conio.h>
class circle
{
private: float r,a,c,x,y;
public: circle()
{ r=7; x=6; y=8; }
void area()
{ a=3.14*r*r; }
void circum()
{ c=2*3.14*r; }
void print()
{
cout<<"The radius of the circle is"<<r;
cout<<"\n\nThe x,y coordinate of center is"<<x<<","<<y;
cout<<"\n\nThe area of circle is="<<a;
cout<<"\n\nThe circumference of circle is"<<c;
}
};
void main()
{ clrscr();
circle c;
c.area();
c.circum();
c.print();
}
Output
The radius of the circle is 7
The x,y, coordinate of center is 6,8
The area of circle is 153.860001
The circumference of circle is 43.959999
}
return 0;
}
Output
Enter any 10 numbers 1 3 4 5 6 8 9 12 14 15
Enter to be searched 8
Number found at location 6
Enter any 10 numbers 1 3 4 5 6 8 9 12 14 15
Enter to be searched 18
Number not found
//Output
Enter the elements of the array
10
9
8
7
6
5
4
3
2
1
Original Array is
10
9
8
7
6
5
4
3
2
1
After Bubble sort Ascending order is
1
2
3
4
5
6
7
8
9
10
}
void dispscore()
{
cout<<"\nScore in sports="<<score<<endl;
}
};
class result: public test, public sports
{
float total;
public: void display()
{
total=marks1+marks2+score;
dispro();
dispmarks();
dispscore();
cout<<"Total marks"<<total<<endl;
}
};
void main()
{
clrscr();
result s1;
s1.setno(100);
s1.setmarks(20,20);
s1.setscore(10);
s1.display();
getch();
}
}
void conv_pol_rec()
{
float x,y;
x=r*cos(t*3.14/180);
y=r*sin(t*3.14/180);
cout<<"\n\nPolar to Rectangle conversion is";
cout<<"\n x="<<x;
cout<<"\n y="<<y;
}
};
void main()
{
clrscr();
rectangle rect1;
rect1.getdata1();
rect1.con_rec_pol();
polar pol1;
pol1.getdata2();
pol1.conv_pol_rec();
getch();
}
Output
Enter the rectangular coordinates
x=2
y=3
Rectangle to polar conversion is
r=3.605551
theta=56.338493
Enter the polar coordinates
r=3.605551
theta=56.338493
Polar to rectangle conversion is
x=2
y=3
ratio r;
r.assign();
cout<<"Original ratio is=";
r.print();
cout<<"Inverse ratio is=";
r.convert();
r.invert();
r.print();
getch();
}
Output
Enter Numerator
2
Enter Denominator
3
Original Value is = 2/3
Inverse Value is = 3/2
p=&y;
p->print();
getch();
}
// Output
Name of the person assigned through base object is BOB
Name of the person assigned through derived object is TOM
HTML
Program No 1 : Design a HTML Page for College
Home.html
<html><head>
<title> College profile</title></head>
<body bgcolor="green">
<marquee behavior=alternate><h1 align="center"><font color=red> PACE
Junior Science College</font></h1> </center></marquee><br>
<p><font face="Century" color="white"> Four years ago, IIT-ian's Pace
introduced the unique concept of integrated learning for Competitive Exams,
Board Exams
through partnerships with the most reputed schools and colleges across
Mumbai.</p><br><br>
<p>In 2009, the Government of Maharashtra entrusted IIT-ian's Pace with the
responsibility to manage two Junior Science colleges in collaboration with the
MCGM. These colleges offer integrated Competitive Exam preparation and
Board
preparation under one roof.</p><br><br>
<p>Today, the success of this concept has led to a revolution for competitive
exams and boards. In a landmark
ruling, <u>the Government of Maharashtra awarded IIT-ian's Pace</u>
special permission to run 6 Pace Junior Science colleges across
Mumbai.</font> <br><br>
<h3><a href="courses.html">Courses</a><br>
<a href="admission.html">Admission process</a><br>
<img src="pace.jpg"></img >
</body>
</html>
Admission.html
<html><head><title>Admission</title></head>
<body>
<marquee><font color=red><h2>6 Pace Junior Science Colleges (Andheri,
Borivali, Dadar, Nerul, Powai, Thane)</h2></font></marquee><br><br>
<b><u>Eligibility Criteria</u>:</b> Direct admission to the students scoring
90% and above in PCM in X Boards or
IX Final exams. Aptitude test is compulsory for other students.<br>
<br><br>
<b><u>Admission Form</u>:</b> To be collected from the respective Pace
Junior Science Colleges/ centers
<br><br>
<b><u>Documents required</u>:</b><br>
<ol type="A">
<li>X standard mark sheet (original with attested copy)</li>
<li>School Leaving Certificate</li>
<li>5 passport size photographs</li>
</ol>
<br><h3><a href="courses.html">Courses</a><br>
<a href="home.html">Home</a>
</body>
</html>
Courses.html
<html><head>
<title> Courses offered</title></head>
<body bgcolor=green><font color=black>
<marquee><h2>Courses available at PACE Junior Science
College</h2></marquee></font>
<font size=5 color=white><pre>
<ol>
<li> XI and XII
IITJEE / AIEEE </li>
<li> XI and XII
MH-CET </li>
<li> XI and XII </li>
</ol></pre></font>
<u><i><h3> <font color=black>Vocational subjects offered at Pace Junior
Science College</font> </h3></i></u>
<font size=4 color=white><ul>
<li>Electrical Maintenance </li>
<li> Computer Science </li>
</ul></font>
<br><h3><a href="admission.html">Admission</a><br>
<a href="home.html">Home</a>
</body>
</html>
<td align="center">85</td>
</tr>
</table>
<p><a href="home.html"><img src="Sunset.jpg" height=200
width=250></img></a></p>
</font> </body> </html>
Paper II : Hardware
Programs for 8085 Microprocessor
Q 1) A Block of data is stored in memory location starting from C040. Length of the
block is stored in register D. Write a program to transfer the entire block of data to
another memory location starting from memory location C050
Memory Op- Labels
Location Code
C000
C001
40
C002
C0
C003
C004
50
C005
C0
C006
C007
Mnemonics
Comments
LXI H, C040H
LXI B, C050H
MVI D, 05 H
MOV A,M
05
C008
:UP
C009
STAX B
C00A
INX H
C00B
INX B
C00C
DCR D
C00D
JNZ
C00E
08
C00F
C0
C010
UP:
RST 1
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
01 H
02 H
03 H
04 H
05 H
After Execution :
A=
D=
F=
C050 =
C051 =
C052 =
C053 =
C054 =
F=
S Z X AC X P X CY
Q2) A Block of data is stored in memory location starting from C040. Length of the
block is stored in register D. Write a program to transfer the entire block of data to
another memory location starting from memory location C050 in reverse order.
Memory Op- Labels
Location Code
C000
C001
40
C002
C0
C003
C004
54
C005
C0
C006
C007
Mnemonics
Comments
LXI H, C040H
LXI B, C054H
MVI D, 05 H
MOV A,M
05
C008
:UP
C009
STAX B
C00A
INX H
C00B
DCX B
C00C
DCR D
C00D
JNZ
C00E
08
C00F
C0
C010
UP:
RST 1
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
01 H
02 H
03 H
04 H
05 H
After Execution :
A=
D=
F=
C050 =
C051 =
C052 =
C053 =
C054 =
F=
S Z X AC X P X CY
Q3)A block of data is stored in memory location starting from memory location
C040 . Another block of data is stored in memory location starting from memory
location C050. Length of the blocks is stored in register D. Write a program to
exchange / swap the data contents of both these blocks
Memory Op- Labels
Location Code
C000
C001
40
C002
C0
C003
C004
50
C005
C0
C006
C007
Mnemonics
Comments
LXI H, C040H
LXI B, C050H
MVI D, 05 H
LDAX B
05
C008
: UP
C009
MOV E , A
C00A
MOV A ,M
C00B
STAX B
C00C
MOV M , E
C00D
INX H
C00E
INX B
C00F
DCR D
C010
C011
C012
C013
JNZ
UP:
08
C0
RST 1
OUTPUT :
Before Execution :
C040 = 01 H
C041 = 02 H
C042 = 03 H
C043 = 04 H
C044 = 05 H
C050
=
C051
=
C052
=
C053
=
C054
=
06H
07H
08H
09H
0AH
After Execution :
A=
D=
F=
C040 =
C041 =
C042 =
C043 =
C044 =
C050
=
C051
=
C052
=
C053
=
C054
=
S Z X AC X P X CY
Q 4) A block of data is stored in memory location starting from C040 . Length of the
block is stored in register B. Write a program to add the data content of the memory
location and store the result at the end of the block.
Memory Op- Labels
Location Code
C000
C001
Comments
XRA A
LXI H, C040H
C002
40
C003
C0
C004
C005
Mnemonics
MVI B, 05 H
ADD M
05
C006
:UP
C007
INX H
C008
DCR B
C009
JNZ
C00A
06
C00B
C0
UP:
C00C
MOV M ,A
C00D
RST 1
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
01 H
02 H
03 H
04 H
05 H
After Execution :
A=
B=
F=
=
C045
F
S Z X AC X P X CY
Q 5) A block of data is stored in memory location starting from C041 . Length of the
block is stored in memory location C040. Write a program to add the data content of
the memory location and store the result at the end of the block.
Memory Op- Labels
Location Code
C000
C001
Mnemonics
Comments
XRA A
LXI H, C040H
C002
40
C003
C0
C004
MOV B , M
C005
INX H
C006
:UP
ADD M
C007
INX H
C008
DCR B
C009
JNZ
C00A
06
C00B
C0
UP:
C00C
MOV M ,A
C00D
RST 1
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
C045
05H
01 H
02 H
03 H
04 H
05 H
After Execution :
A=
B=
F=
=
C046
F
S Z X AC X P X CY
Q 6) A block of data is stored in memory location starting from C040 . Length of the
block is stored in register B. Write a program to find the largest number from the
given block of data and store it at the end of the block.
Memory Op- Labels
Location Code
C000
C001
40
C002
C0
C003
C004
Comments
LXI H, C040H
MVI A, 00 H
MVI B, 05 H
CMP M
00
C005
C006
Mnemonics
05
C007
: UP
C008
JNC NEXT :
C009
0C
C00A
C0
C00B
MOV A , M
C00C
:
NEXT
INX H
C00D
DCR B
C00E
JNZ UP :
C011
MOV M , A
C012
RST 1
C00F
07
C010
C0
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
01 H
02 H
0A H
04 H
05 H
After Execution :
A=
B=
F=
=
C045
F
S Z X AC X P X CY
Q 7) A block of data is stored in memory location starting from C040 . Length of the
block is stored in register B. Write a program to find the smallest number from the
given block of data and store it at the end of the block.
Memory Op- Labels
Location Code
C000
C001
40
C002
C0
C003
C004
Comments
LXI H, C040H
MVI A, FF H
MVI B, 05 H
CMP M
FF
C005
C006
Mnemonics
05
C007
: UP
C008
JC NEXT :
C009
0C
C00A
C0
C00B
MOV A , M
C00C
:
NEXT
INX H
C00D
DCR B
C00E
JNZ UP :
C011
MOV M , A
C012
RST 1
C00F
07
C010
C0
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
06 H
07 H
0A H
08 H
01 H
After Execution :
A=
B=
F=
=
C045
F
S Z X AC X P X CY
Q 8) A block of data is stored in memory location starting from C040. Length of the
block is stored in register B. Write a program to find the first occurrence of the
number AB H from the given block of data and if the number is not found store FFFF
H in HL - pair
40
C002
C0
C003
C004
Comments
LXI H, C040H
MVI A, AB H
MVI B, 05 H
CMP M
AB
C005
C006
Mnemonics
05
C007
: UP
C008
JZ NEXT :
C009
13
C00A
C0
C00B
INX H
C00C
DCR B
C00D
JNZ UP :
LXI H, FFFF H
RST 1
C00E
07
C00F
C0
C010
C011
FF
C012
FF
C013
:NEXT
OUTPUT :
Case I:
Before Execution :
C040 = 01 H
C041 = 02 H
C042 = AB H
C043 = 04 H
C044 = AB H
After Execution :
A=
B=
H=
L=
F=
F=
Case II:
S Z X AC X P X CY
Before Execution :
C040 = 01 H
C041 = 02 H
C042 = 03 H
C043 = 04 H
C044 = 05 H
After Execution :
A=
B=
H=
L=
F=
F=
S Z X AC X P X CY
Q 9) A block of data is stored in memory location starting from C040. Length of the
block is stored in register B. Write a program to find the number of times the data
AB H occurred from the given block of data and store the result at the end of the
block
Memory Op- Labels
Location Code
C000
C001
40
C002
C0
C003
C004
LXI H, C040H
MVI A, AB H
MVI B, 05 H
MVI C , 00 H
CMP M
05
C007
C008
Comments
AB
C005
C006
Mnemonics
00
C009
: UP
C00A
JNZ NEXT :
C00B
0E
C00C
C0
C00D
INR C
C00E
:NEXT
INX H
C00F
DCR B
C010
JNZ UP :
C013
MOV M , C
C014
RST 1
C011
09
C012
C0
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
AB H
02 H
AB H
04 H
AB H
After Execution :
A=
B=
C=
=
C045
F=
S Z X AC X P X CY
Q 10) A block of data is stored in memory location starting from C040. Length of the
block is stored in register B. Write a program to find the total number of odd and
even numbers from the given block of data and stored it at the end of block
Memory OpLocation Code
C000
C001
40
C002
C0
Labels
C003
C004
Mnemonics
Comments
LXI H, C040H
MVI B, 05 H
MVI D, 00 H
MVI E , 00 H
MOV A , M
05
C005
C006
C007
00
C008
C009
00
: up
C00A
RRC
C00B
JC NEXT :
C00C
C00D
C00E
12
C0
INR C
C00F
C010
C011
C012
C013
JMP DOWN :
13
C0
: NEXT
INR D
: DOWN
INX H
C014
DCR B
C015
JNZ UP :
Mnemonics
Comments
C018
MOV M , D
C019
INX H
C01A
MOV M , E
C01B
RST 1
C017
Labels
C0
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
01 H
02 H
03 H
04 H
05 H
After Execution :
A=
B=
D=
E=
F=
C045 =
=
C046
F=
S Z X AC X P X CY
Q 11) Two numbers are stored in consecutive memory location starting from C040.
Write a program to multiply the numbers and store the result in the next memory
location.
Memory Op- Labels
Location Code
C000
C001
Mnemonics
Comments
XRA A
LXI H, C040H
C002
40
C003
C0
C004
MOV B , M
C005
INX H
C006
:UP
ADD M
C007
DCR B
C008
JNZ
C009
06
C00A
C0
UP:
C00B
INX H
C00C
MOV M ,A
C00D
RST 1
OUTPUT :
Before Execution :
C040 = 03 H
C041 = 04 H
After Execution :
A=
B=
F=
=
C042
F=
S Z X AC X P X CY
Q 12) An one byte number is stored in memory location starting from C030. Write a
program to separate the two nibbles of the one byte number and store them in the
next memory location. Also write a program to multiply the separated nibbles and
store the result at the end of the block
Memory OpLocation Code
C000
Mnemonics
Comments
LXI H, C030H
C003
MOV A , M
C004
ANI , 0F H
C001
30
C002
C0
C005
Labels
0F
C006
MOV B , A
C007
INX H
C008
MOV M ,A
C009
DCX H
C00A
MOV A , M
C00B
ANI , F0 H
C00C
F0
C00D
RRC
C00E
RRC
C00F
RRC
C010
RRC
C011
INX H
C012
INX H
C013
MOV M , A
C014
XRA A
C015
:UP
C016
ADD M
DCR B
C017
JNZ
C018
15
C019
C0
UP :
C01A
INX H
C01B
MOV M ,A
C01C
RST 1
OUTPUT :
Before Execution :
C030 = 32 H
After Execution :
A=
B=
F=
C031 =
C032 =
=
C033
F=
S Z X AC X P X CY
Q 13) Two numbers are stored in consecutive memory location starting from C040.
Write a program to subtract the numbers and store the absolute difference result in
the next memory location.
Memory Op- Labels
Location Code
C000
Mnemonics
Comments
LXI H, C040H
C003
MOV A , M
C004
INX H
C005
SUB M
C001
40
C002
C0
C006
JP
C007
0B
C008
C0
DOWN :
C009
CMA
C00A
INR A
C00B
:
DOWN
INX H
C00C
MOV M ,A
C00D
RST 1
OUTPUT :
Case I :
Before Execution :
C040 = 09 H
C041 = 04 H
After Execution :
A=
F=
=
C042
F
S Z X AC X P X CY
Case II :
Before Execution :
C040 = 04 H
C041 = 09 H
After Execution :
A=
F=
=
C042
F
S Z X AC X P X CY
Q 14)Two numbers are stored in memory location starting from C040 . Write a
program to divide the two numbers and store the quotient and remainder in the
next consecutive memory locations.
Memory OpLocation Code
C000
Mnemonics
Comments
LXI H, C040H
MVI C , 00H
C005
MOV A , M
C006
INX H
C001
40
C002
C0
Labels
C003
C004
00
C007
:UP
C008
CMP M
JC DOWN :
C009
10
C00A
C0
C00B
SUB M
C00C
INR C
C00D
JMP UP:
C00E
07
C00F
C0
C010
:DOWN
INX H
C011
MOV M , C
C012
INX H
C013
MOV M , A
C014
RST 1
OUTPUT :
Before Execution :
C040 = 09 H
C041 = 02 H
After Execution :
A=
C=
F=
C042 =
=
C043
F
S Z X AC X P X CY
Q 15)A 4-byte number is stored in memory location starting from C040. Write a
program to find whether the given 4-bybe number is a palindrome or not . If it is a
palindrome then store 00 H in memory location C060 and if it is not a palindrome
then store FF H in memory location C060. For eg. Take the 4-byte number as
AB5005BA H
Memory Op- Labels
Location Code
C000
C001
40
C002
C0
C003
C004
43
C005
C0
C006
C007
C008
Mnemonics
Comments
LXI H, C040H
LXI D, C043H
MVI B , 02H
LDAX D
02
: UP
C009
RRC
C00A
RRC
C00B
RRC
C00C
RRC
C00D
CMP M
C00E
JZ NEXT:
C00F
19
C010
C0
C011
C012
MVI A , FF H
STA C060 H
JMP END :
INX H
FF
C013
C014
60
C015
C0
C016
C017
24
C018
C0
C019
:NEXT
C01A
DCX D
C01B
DCR B
C01C
JNZ UP :
C01D
08
C01E
C0
C01F
C020
STA C060 H
RST 1
00
C021
C022
60
C023
C0
C024
MVI A , 00 H
:END
OUTPUT :
Case I
Before Execution :
C040 =
C041 =
C042 =
C043 =
AB H
50 H
05 H
BA H
After Execution :
A=
B=
F=
=
C060
F
S Z X AC X P X CY
Case II
Before Execution :
C040 =
C041 =
C042 =
C043 =
AB H
50 H
55 H
BA H
After Execution :
A=
B=
F=
=
C060
F
S Z X AC X P X CY
Q 16) A 2-byte number is stored in memory location starting from C040 beginning
with lower order byte byte. Another 2- byte number is stored in memory location
starting from C050 beginning with lower order byte. Write a program to add these
two numbers and store the result in memory location starting from C060 beginning
with lower order byte.
Memory Op- Labels
Location Code
C000
C001
40
C002
C0
C003
C004
C005
C006
Mnemonics
Comments
LXI H, C040H
LXI B, C050H
LDAX B
50
C0
C007
ADD M
C008
STA C060
C009
60
C00A
C00B
CO
INX H
C00C
INX B
C00D
LDAX B
C00E
ADC M
C00F
STA C061
C010
61
C011
C012
C0
RST 1
OUTPUT :
Before Execution :
C040 = C9 H
C041 = AB H
After Execution :
A=
F=
C060 =
C061 =
F=
S Z X AC X P X CY
C050 = C2 H
C051 = FE H
Q 17) A 4-byte number is stored in memory location starting from C040 beginning
with lower order byte byte. Another 4- byte number is stored in memory location
starting from C050 beginning with lower order byte. Write a program to add these
two 4- byte numbers and store the result in memory location starting from C040
beginning with lower order byte.
Memory Op- Labels
Location Code
C000
C001
Mnemonics
Comments
XRA A
LXI H, C040H
C002
40
C003
C0
C004
C005
C006
C007
50
C0
C008
04
C009
:UP
LXI B, C050H
MVI D , 04 H
LDAX B
C00A
ADC M
C00B
MOV M , A
C00C
INX H
C00D
INX B
C00E
DCR D
C00F
JNZ UP:
C010
09
C011
C012
C0
RST 1
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C9 H
AB H
FD H
FE H
C050 =
C051 =
C052 =
C053 =
After Execution :
A=
D=
F=
C040 =
C041 =
C042 =
C043 =
F=
S Z X AC X P X CY
C2 H
FF H
C9 H
FF H
Q 18) A block of data is stored in memory location starting from C041. Length of
data is stored in memory location C040. Write a program to add this numbers by
using DAD instruction. Store the two byte result at the end of the block
Memory Op- Labels
Location Code
C000
C001
40
C002
C0
C003
C004
00
C005
00
C006
C007
00
C008
00
C009
C00A
: UP
Mnemonics
Comments
LXI H, C040H
LXI B, 0000H
LXI D, 0000H
MOV A ,M
INX H
C00B
MOV C ,M
C00C
XCHG
C00D
DAD B
C00E
XCHG
C00F
DCR A
C010
JNZ
C011
0B
C012
C0
UP :
C013
INX H
C014
MOV M , E
C015
INX H
C016
MOV M , D
C017
RST 1
OUTPUT :
Case I : Before Execution :
C040 = 05 H
C041 = C9 H
C042 = AB H
C043 = FD H
C044 = FE H
C045 = C9 H
After Execution :
A=
F=
C046 =
C047 =
F=
S Z X AC X P X CY
Q 19) A block of data is stored in memory location starting from C041. Length of
data is stored in memory location C040. Write a program to sort the content of the
block in ascending order.
Memory Op- Labels
Location Code
C000
:START
C001
Mnemonics
MVI B ,00 H
00
C002
Comments
Set the data content of
register to 00H
LXI H, C040H
C005
MOV C, M
C006
INX H
C007
MOV A , M
C008
DCR C
C003
40
C004
C0
C009
: UP
INX H
C00A
CMP M
C00B
JC DOWN :
C00C
15
C00D
C0
C00E
MOV D , M
C00F
MOV M , A
C010
DCX H
C011
MOV M , D
C012
INX H
C013
MVI B, 01 H
C014
01
C015
:
DOWN
C016
DCR C
JNZ
C017
09
C018
C0
C019
UP :
DCR B
C01A
JZ
C01B
00
C01C
C0
C01D
START :
RST 1
OUTPUT :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
C045 =
05 H
04 H
03 H
02 H
05 H
01 H
After Execution :
A=
B=
F=
C041 =
C042 =
C043 =
C044 =
C045 =
F=
S Z X AC X P X CY
Q 20) A block of data is stored in memory location starting from C041. Length of
data is stored in memory location C040. Write a program to sort the content of the
block in descending order.
Memory Op- Labels
Location Code
C000
:START
C001
Mnemonics
MVI B ,00 H
00
C002
Comments
Set the data content of
register to 00H
LXI H, C040H
C005
MOV C, M
C006
INX H
C007
MOV A , M
C008
DCR C
C003
40
C004
C0
C009
: UP
INX H
C00A
CMP M
C00B
JNC DOWN :
C00C
15
C00D
C0
C00E
MOV D , M
C00F
MOV M , A
C010
DCX H
C011
MOV M , D
C012
INX H
C013
MVI B, 01 H
C014
01
C015
:
DOWN
C016
DCR C
JNZ
C017
09
C018
C0
C019
UP :
DCR B
C01A
JZ
C01B
00
C01C
C0
C01D
START :
RST 1
Output :
Before Execution :
C040 =
C041 =
C042 =
C043 =
C044 =
C045 =
05 H
04 H
03 H
02 H
05 H
01 H
After Execution :
A=
B=
F=
C041 =
C042 =
C043 =
C044 =
C045 =
F=
S Z X AC X P X CY