ASM program to find the length of the given string

Sunday, June 3rd, 2012

Aim: – To write an assembly language program to find the length of the given string.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
MOV AX, DATA
MOV CS, AX
MOV DS, AX
MOV BX, 00
MOV CL, 00
LOOP:		MOV AL, A[BX]
CMP AL, 00
JE L1
INC BX
INC CL
JMP LOOP
L1:		DEC CL
MOV LEN, CL
END

Result: Length of the given string is obtained.

Avatar of chitra

Author Name :
chitra

Total : 0 Comment


Leave a Reply

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: