Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(.the code below create the array from the user input when is call comp_loop it

ID: 3655637 • Letter: #

Question

(.the code below create the array from the user input when is call comp_loop it need to get the max and min from the array) STACK 100H . DATA prompt_msg1 db ' Please input size of array:',0 prompt_msg2 db ' please input a number :',0 out_msg1 db 'Max: ',0 out_msg2 db 'Min: ',0 .UDATA NO_STUDENTS resw 1 test_marks resd 5 .CODE . STARTUP PutStr Prompt_msg1 GetInt [NO_STUDENTS] nwln PutStr prompt_msg2 mov ECX, [NO_STUDENTS] sub ESI, ESI r_loop: GetLInt [test_marks+ESI*4] nwln inc ESI loop r_loop call comp_loop done: . EXIT comp_loop:

Explanation / Answer

DATA SEGMENT A DW 8,2,5,6,1,3 DATA ENDS CODE SEGMENT ASSUME DS:DATA,CS:CODE START: MOV AX,DATA MOV DS,AX MOV CX,0000 MOV CL,06 LEA BX,A MOV DX,WORD PTR[BX] MOV AX,0000 L1:CMP AX,WORD PTR[BX] JNC L2 MOV AX,WORD PTR[BX] L2:CMP DX,WORD PTR[BX] JC L3 MOV DX,WORD PTR[BX] L3:ADD BX,02 DEC CL CMP CL,00 JNZ L1 MOV AH,4CH INT 21H CODE ENDS END START ;OUTPUT:-> ;-G CS: 0028 ; ;AX=0008 BX=000C CX=0000 DX=0001 SP=0000 BP=0000 SI=0000 DI=0000 ;DS=0BF4 ES=0BE4 SS=0BF4 CS=0BF5 IP=0028 NV UP EI PL ZR NA PE NC ;0BF5:0028 B44C MOV AH,4C