Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Consider the following main - code fragment and the procedure SumThem: . DATA IntArray WORD 1 0 , 5 , 2 0 , 1 5

Consider the following "main"-code fragment and the procedure "SumThem":
.DATA
IntArray WORD 10,5,20,15,45,10
B WORD 20
C WORD 30. CODE
. CODE
mov ax,@data
mov ax, @d, ax
push IntArray ??????
push Intarray+2
push IntArray ; (4) push 4
push 4 call SumThem ; (5)
add sp,10
mov ah,4ch
int 21h
main ENDP
; (6)
SumThem PROC NEAR
push bp
push bp mov bp,sp
mov Contents of cx :
; Just Before Pass 1: di=
,ax=
,cx=
mov ax,
cmp cx,
; End of Pass 1: di=
, ax:
,cx=
jmp le ExitProc
mov di,6
; End of Pass 2: di=
,ax=
,cx=
Theloop:
add ax,[bp+di] ; End of Pass 3: di=
,ax=
,cx=
add di,2
dec cx
; End of Pass 4: di=
,ax=
,cx=
; End of Pass.
jnz TheLoop
; End of Pass 5: di=
,ax=
,cx=
pop bp ret
SumThem ENDP
(8)
END main
(0)
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
; How many passes were actually made?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions