// Human Intention "Find the largest number in the array" Think: iterate, compare, remember maximum
// Pseudocode max = first element for each element in array: if element > max: max = element return max
// Machine Code mov eax, [esi] ; load first element lea ecx, [esi+4] ; point to second cmp ecx, edi ; check bounds jge done ; if past end, done loop: cmp [ecx], eax ; compare current with max cmovg eax, [ecx] ; conditionally move if greater add ecx, 4 ; next element cmp ecx, edi ; check bounds jl loop ; repeat if not done done: