MAXIMUM number in series

TITLE greatest number in a series
  .model small
  .stack 100h
  .data
  list db 80, 81, 78, 65, 23, 45, 89, 90, 10, 99
  result db ?
  .code
  main proc
  mov ax, @data
  mov ds, ax
  mov si, offset list
  mov al, 00h
  mov cx, 0ah
back: cmp al, [si]
  jnc ahead
  mov al, [si]
ahead: inc si
  loop back
  mov result, al
  mov ah, 4ch
  int 21h
  main endp

  end main

No comments:

Post a Comment