Google Search

Thursday, October 13, 2011

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


THE LENGTH OF THE GIVEN STRING

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

                      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.

0 comments:

Post a Comment