Question
I need to write a code in assembly language (kip irvene) that Reads in a string from the user (up to 50 characters). Reverse the
I need to write a code in assembly language (kip irvene) that Reads in a string from the user (up to 50 characters). Reverse the contents of the string. Display the string. Use the STACK. This is the code i have but I have to use the stack, help? ==============================================================
INCLUDE Irvine32.inc
.data myString BYTE 51 DUP (0) myStringLength DWORD 0
.code Main PROC call Clrscr
mov ecx,50 mov edx, OFFSET myString ;reading the string call ReadString
mov myStringLength, eax
xor edx, edx mov ebx, 2 div ebx mov ecx, eax
xor esi, esi mov edi, myStringLength dec edi
L1: mov al, [myString + esi] mov ah, [myString + edi] mov [myString + edi], al mov [myString + esi], ah
inc esi dec edi loop L1
mov edx, OFFSET myString call WriteString call crlf
exit main ENDP
END main
================================================ Edit or start new code using the same variables to complete this task, and with notes would be nice. Thank you.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started