Advertisement
MHSS

largest no.

Oct 24th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //largest
  2. data segment
  3. array db 01h,02h,03h,04h,05h,06h,07h,08h,09h,10h,20h,30h,40h,50h,0ah,0bh,0ch,0dh,0eh,60h
  4. largest db ?
  5. data ends
  6.  
  7. code segment
  8. assume cs:code,ds:data
  9. start: mov ax,data
  10.        mov ds,ax
  11.  
  12.        mov cl,13h
  13.        lea si,array
  14.        mov al,[si]
  15. up:    inc si
  16.        mov bl,[si]
  17.        cmp al,bl
  18.        jnc down
  19.        mov al,bl
  20. down:  dec cl
  21.        jnz up
  22.        mov largest,al
  23.        int 03h
  24. code ends
  25. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement