without using push or pop: loop, use indirect addressing that switches the 1 st
ID: 3593368 • Letter: W
Question
without using push or pop:
loop, use indirect addressing that switches the 1st and 2nd elements of the array. Then does the same for the 3rd and 4th elements. And so on.
Your word array is named warray and has the values 3, 5, 8 , 7, 13, 19, 17, 19 in it.
INCLUDE Irvine32.inc
.data
warray DWORD 3, 5, 8, 7, 13, 19, 17, 19
.code
main PROC
mov esi, OFFSET warray
mov ecx, LENGTHOF warray ;ecx register for our counter(8/2=4)
mov ebx, TYPE warray
L1:
mov eax, warray
mov eax, [warray + 4]
loop L1
call DumpMem ; See the results in Array
call DumpRegs ;display registers
call WaitDec ;display output in decimal form
call WaitMsg ;will keep window running
exit
main ENDP
end main
Explanation / Answer
INCLUDE Irvine32.inc
.data
warray DWORD 3, 5, 8, 7, 13, 19, 17, 19
.code
main PROC
mov esi, OFFSET warray
mov ecx, LENGTHOF warray ;ecx register for our counter(8/2=4)
mov ebx, TYPE warray
L1:
mov eax, warray
mov eax, [warray + 4]
loop L1
call DumpMem ; See the results in Array
call DumpRegs ;display registers
call WaitDec ;display output in decimal form
call WaitMsg ;will keep window running
exit
main ENDP
end main
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.