Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
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 main PROC mov ax,@data
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 main PROC mov ax,@data mov ds,ax ; (0) push \[ IntArray \]; (1) push \[ Intarray +2\1]; (2) push \[ IntArray+4\\] ; (3) push \\[ IntArray+6\\] ; (4) push 4 ; (5) call SumThem ; (6) add Sp,10; (9) Also, suppose the ADDRESS of this instruction is 3000h. mov " ah, 4 ch int 21h main ENDP SumThem PROC NEAR push bp ; (7) Suppose bp value was 4000. mov bp,sp. mov cx,\\[bp+4\\]; Contents of cx : ; Just Before Pass 1: di= , ax= , cx= mov ax, 0 cmp cx, 0 , 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= add di,2 dec cx ; End of Pass 4: di= , ax= , Cx= ; End of Pass. inz TheLoop ; End of Pass 5: di= ax= , Cx= pop bp ret. SumThem ENDP ; How many passes were actually made? END main Fill in the spaces after each instruction, labeled 0 through 9, is executed. The top of the stack should be on the far right. The bottom of the stack should be on the far left. Separate each value by a space. If there is nothing in the stack, write Empty. Also fill in values in the spaces above. If there is no value to be filled in, write None. (0) (1) (2) (3) (4) (5) (6) (7) (8) (9)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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