汇编语言找数组中的最大值

在这里插入代码片
```include Irvine32.inc
FindLargest proto ,haha:ptr dword,big:ptr dword,small:dword
.data
must  dword 89,76,54,36,98,100
must1 dword 7,8,7,6,4,59,10,36
must2 dword 38,83,34,89
must3 dword 78,36
.code
main proc
  invoke FindLargest,addr [must3 + 4] ,offset must3,lengthof must3
  exit
main endp
FindLargest proc uses esi edi ecx ebx edx ,haha:ptr dword,big:ptr dword,small:dword
  mov esi,big 
  mov edi,haha
  mov ecx,small
  mov edx,0
  sub ecx,1
L1:
  mov ebx,[esi]
  cmp ebx,[edi]
  jna L4
L3:
  add edi,4
  add edx,4
  mov eax,[esi]
  jmp L6
L4:
  add edx,4
  add esi,edx
  mov eax,[esi]
  add edi,4
  mov edx,0
L6:
  loop L1
  ret 
FindLargest endp
end main

你可能感兴趣的:(汇编语言)