AIM:
To write a program to determine GCD of Two Numberss
ALGORITHM:
1.Compare number 1(no1) with number 2(no2).If no1==no2,go to step 3.Else if no1<no2 ,then exchange no1 and no2.
2.no1=no1-no2; go to step 1
3.Display result as no1.
PROGRAM:
LXI H,8000H
MOV A,M
INX H
MOV B,M
L1: CMP B
JZ OUT
JC L2
SUB B
JMP L1
L2 : MOV C,B
MOV B,A
MOV A,C
JMP L1
OUT: STA 8003H
HLT
OBSERVATION:
RESULT:
Thus the given array of data was arranged in ascending order.
To write a program to determine GCD of Two Numberss
ALGORITHM:
1.Compare number 1(no1) with number 2(no2).If no1==no2,go to step 3.Else if no1<no2 ,then exchange no1 and no2.
2.no1=no1-no2; go to step 1
3.Display result as no1.
PROGRAM:
LXI H,8000H
MOV A,M
INX H
MOV B,M
L1: CMP B
JZ OUT
JC L2
SUB B
JMP L1
L2 : MOV C,B
MOV B,A
MOV A,C
JMP L1
OUT: STA 8003H
HLT
OBSERVATION:
RESULT:
Thus the given array of data was arranged in ascending order.
I recommend to all This article To every One.
ReplyDeleteHow to Check Diode Working condition
Here You Can Find Unlimited Whatsapp group Name For Promoting Your group
Also You can see This Online Money Earning Ways
Top 25 Tamil Movies Download Website
இதுவும் உங்களுக்கு உதவியாக இறுக்கும் நீங்கள் வளர வாழ்த்துக்க்கள் தமிழ் படங்களை பார்க்க 25 website Tamil Movies Website
You Need Governement Job Then Go to This Link Ind Govt job
thanks please help me how to write aprogram to caculate average of two numbers
ReplyDelete