.386 .model flat, stdcall .stack 4096 ExitProcess PROTO, dwExitCode: DWORD   .data   Array WORD 10, 2, 23, 45, 21, 11   MAXIMUM WORD ?   .code main PROC   mov ecx, LENGTHOF Array  ; to loop through every item   mov esi, OFFSET Array    ; points to the first item of the array   mov ax, 0            ; start with 0 as the highest value     L1:       XXXXXX    ; compares current max with current item     JAE L2 ; if ax is larger or equal to the current item, no change in ax. Just move to next element      XXXXXXX         ; update ax with the current element, so it becomes the new max     L2:                    XXXXXXX      ; move to the next item of the array     loop L1                ; if there are more items, loop again     mov MAXIMUM, ax          ; finally, move the max value into MAXIMUM     INVOKE ExitProcess, 0   main ENDP END main

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 29SA
icon
Related questions
Question

Please fill in the blanks where all the XXXXXXX   is at

.386

.model flat, stdcall

.stack 4096

ExitProcess PROTO, dwExitCode: DWORD

 

.data

  Array WORD 10, 2, 23, 45, 21, 11

  MAXIMUM WORD ?

 

.code

main PROC

  mov ecx, LENGTHOF Array  ; to loop through every item

  mov esi, OFFSET Array    ; points to the first item of the array

  mov ax, 0            ; start with 0 as the highest value

 

  L1:

      XXXXXX    ; compares current max with current item

    JAE L2 ; if ax is larger or equal to the current item, no change in ax. Just move to next element

     XXXXXXX         ; update ax with the current element, so it becomes the new max

    L2:              

     XXXXXXX      ; move to the next item of the array

    loop L1                ; if there are more items, loop again

 

  mov MAXIMUM, ax          ; finally, move the max value into MAXIMUM

 

  INVOKE ExitProcess, 0

 

main ENDP

END main

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Stack
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning