12/9/2018 7.
Program to Copy a String in Reverse Order in Assembly Language using Visual Studio
Programming Tutorials
SUBSCRIBE
Careem Bike se roz khoob kamao
Jitni rides, utni kamai! Woh bhi apne waqt par, Aaj he Careem Bike ke Captain banein OPE
[Link]
7. Program to Copy a String in Reverse
Order in Assembly Language using Visual
Studio
February 10, 2018
Chapter 3
Assembly Language Fundamentals
Assembly Language Programming Exercise
Problem # 7:
Write a program with a loop and indirect addressing that copies a
string from source to target, reversing the character order in the
process. Use the following variables:
source BYTE "This is the source string",0
target BYTE SIZEOF source DUP('#')
Solution:
.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
.data
source BYTE "This is the source string",0
target BYTE SIZEOF source DUP('#')
.code
main PROC
mov esi,0
mov edi,LENGTHOF source - 1
[Link] 1/4
12/9/2018 7. Program to Copy a String in Reverse Order in Assembly Language using Visual Studio
mov ecx,SIZEOF source
Programming Tutorials
SUBSCRIBE
L1:
mov eax, 0
mov al,source[esi]
mov target[edi],al
inc esi
dec edi
loop L1
INVOKE ExitProcess,0
main ENDP
END main
Let me know in the comment sec on if you have any ques on.
Previous Post:
Program to Reverse an Array in Assembly Language using Visual Studio
Next Post:
Program to Shifting the Elements in an Array in Assembly Language using Visual
Studio
ASSEMBLY BASICS ASSEMBLY LANGUAGE FOR X86 PROCESSORS CHAPTER 4
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE COMPUTER SCIENCE
DATA TRANSFERS ADDRESSING AND ARITHMETIC EXERCISE SOLUTION VISUAL STUDIO
Reactions: funny (0) interesting (0) cool (0)
abdoulaye coulibaly 9 October 2018 at 16:20
hi, thank you for this tutorial.
I'd like to know how to display source and target strings.
Hadiqa Amanullah 19 November 2018 at 00:03
You can use WriteString func on from Irvine32 library as
follows:
mov edx,OFFSET source
call WriteString
mov edx,OFFSET target
call WriteString
Please subscribe and share the blog if you like it.
[Link] 2/4