Documente Academic
Documente Profesional
Documente Cultură
AIM:
To write an assembly language program that finds the average of N numbers and
execute the program using 8085 microprocessor kit.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
RESULT:
Thus an 8085 assembly language program that finds average of N numbers was
written and executed using microprocessor kit.
APPARATUS REQUIRED:
X2=N
2 X2=N+ X2
X2=(N+ X2)/2
X=(N+ X2)/(2*X)
X=((N/X)+X)/2
Xnew= ((N/X)+X)/2
To find the square root of a given number we provide an initial value of the
root, which may be very approximate. In the above equation X is the initial value of the
root given by the programmer. The computer calculates Xnew and compare it with X.
when Xnew=X, it gives the result =Xnew.
ALGORITHM:
Step1: load HL register pair with a memory pointer.
Step2: get the number into an accumulator and E register.
Step3: increment memory pointer.
Step4: get the initial guess to D and B registers.
Step5: call the division program.
Step6: add the initial guess with the accumulator.
Step7: divide the content of accumulator by a value 2 using division program.
Step8: if the calculated value is equal to guess, store the result in the memory location.
Step9: else take calculated value as guess and go to step5.
PROGRAM:
RESULT:
Thus an 8085 assembly language program that finds the square root of a given
number was written and executed using microprocessor kit.
AIM:
APPARATUS REQUIRED:
ALGORITHM:
DCX D —6T
MOV A,E—4T
ORA D —4T
JNZ loop —10T
=24T
24×N×0.33×10-6=0.5
N=63132
=(F69C)H
For delay of 10 s loop is called 20 times.
(20)10=14H
PROGRAM:
RESULT:
Thus the time delay of 10 seconds has been generated using microprocessor
8085 kit and the output has been verified.
DECIMAL COUNTER
AIM:
APPARATUS REQUIRED:
ALGORITHM:
SUBROUTINE:
CALCULATION:
DCX D —6T
MOV A,E—4T
ORA D —4T
JNZ loop —10T
=24T
24×N×0.33×10-6=0.5
N=63132
=(F69C)H
For delay of 2 s loop is called 4 times.
(4)10=(4)H
RESULT:
Thus the decimal counter has been realized using 8085 microprocessor kit and
the result has been verified.
HEXADECIMAL COUNTER
AIM:
APPARATUS REQUIRED:
ALGORITHM:
SUBROUTINE:
CALCULATION:
DCX D —6T
MOV A,E—4T
ORA D —4T
JNZ loop —10T
=24T
24×N×0.33×10-6=0.5
N=63132
=(F69C)H
For delay of 2 s loop is called 4 times.
(4)10=4H
RESULT:
Thus the hexadecimal counter has been realized using 8085 microprocessor kit
and the result has been verified.