ASM program to reverse the given string

Aim: – To write an assembly language program to reverse the given string.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
MOV AX, DATA
MOV DS, AX
MOV ES, AX
MOV CL, 03
LEA SI, A
MOV AX, 04
ADD DI, AX
L1:	MOV AL, [SI]
XCHG AL, [DI]
MOV [SI], AL
INC SI
DEC DI
LOOP L1
END

Result: The given string is reversed.

Chitra
Chitra

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in