Question: IN.86 ASSEMBLY LANGUAGE Need help writing a program that reverses a string using indirect addressing using and the runtime stack (uses push and pop). The

IN.86 ASSEMBLY LANGUAGE Need help writing a program that reverses a string using indirect addressing using and the runtime stack (uses push and pop). The string will be given BY THE USER and be up to 50 characters long. SEE CODE EXAMPLE BELOW AND USE AS STARTING POINT ; Reversing a String (Revstr.asm) ; This program reverses a string INCLUDE Irvine32.inc . cdata Newln byte 13,10,0 aName byte "Abraham Lincoln", 0 name size (S - aName)-1 .code main PROC mov cx, nameSize mov esi, o mov edcdx, offset aName call WriteString call CrLf L1 : movzx eax, aName [esi) ; get character push eax inc esi ;push on stack loop L1Pop from the stack in reverse ; store it in the aName array mov ecx, namesize mov si, o L2 : ; get character pop eax mov aName lesi, alstore in string inc e1 loop L2 mov edx, offset aName call Writestring call CrLf exit main ENDP END main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
