Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I return the maximum number of a SWORD array

Given: ESI holds the base of this array, and EBX holds the number of elements in the array.
Returns: AX has the maximum

This is what I have so far:

ArrayMax PROC
    L1:     cmp ax, [esi]
            JL  L2      ;ax<[esi]
        add esi, TYPE array
        loop L1
    L2:     mov ax, [esi]
        add esi, TYPE array
        loop L1

ret AX

ArrayMax ENDP




I'm concerned with the looping situation, and the logic.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900