Question: In Assembly Language (MASM613 or MASM615), write a program to print the original array and reversed array using PUSH and POP. I have the initial
In Assembly Language (MASM613 or MASM615), write a program to print the original array and reversed array using PUSH and POP.
I have the initial program setup already, but I can't figure out how to do it using PUSH and POP.
This is the template to use:____________________________
TITLE Orig & Reversed Array
INCLUDE Irvine32.inc
.data
a1 DWORD 1, 3, 6, 9, 15, 28, 44
.code
main PROC
MOV esi, OFFSET a1
MOV ecx, LENGTHOF a1
MOV eax, 0
CALL Loops
exit
main ENDP
Loops PROC
L1:
MOV eax, [esi]
ADD esi, TYPE a1
CALL WRITEINT
loop L1
CALL crlf
MOV ecx, LENGTHOF a1
L2:
MOV eax, [esi-4]
CALL WRITEINT
SUB esi, TYPE a1
loop L2
ret
Loops ENDP
END main
___________________________________________________
This code works the way it is. The only thing that needs to be added is push and pop commands. Can you also comment explaining how the push and pop works inside this program as well please.
So what needs to be done: Program needs to display the original array forward and backwords using push and pop. Need help withe push and pop part.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
