You are currently viewing [PRACTICAL] Implement a program to calculate the length of a string given starting and ending location
Microprocessor 8085 programming

[PRACTICAL] Implement a program to calculate the length of a string given starting and ending location

5
(1)

[PRACTICAL] IMPLEMENT A PROGRAM TO CALCULATE THE LENGTH OF A STRING GIVEN STARTING AND ENDING LOCATION

Are you looking for a step-by-step guide to Implement a program to calculate the length of a string given starting and ending location? here are the steps to implement a program to calculate the length of a string given starting and ending location.

Theory:

This program used to calculate the length of a string, starting and ending location is given in the program. Here starting location of string is C1FFh and ending location is C20Fh, total length of string is calculating in register c. Loop is increment location each time from C1FFh to C20F and register c count total location.

Program:

LXI H,C1FFH
LXI D,C20FH
MVI C,00H
NEXT: INR C
MOV A,H
CMP D
JNZ SKIP
MOV A,L
CMP E
JNZ SKIP
HLT
SKIP: INX H
JMP NEXT
HLT

OUTPUT:

C=11

For more practical related to 885 Programming please visit the 8085 Programming link

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

As you found this post useful...

Share this post on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?