section .data
array dd 50000000h,88000000h,66000000h,96326100h,63298541h
arrcnt equ 05
max db "Maximum Number is="
maxlen equ $-max
section .bss
dispbuff resb 02
section .text
global _start
_start:
mov eax,4 ;Printing sum
mov ebx,1
mov ecx,max
mov edx,maxlen
int 80h
mov esi,array
mov ecx,arrcnt
dec ecx
mov eax,[esi]
up1: add esi,4
mov ebx,[esi]
cmp eax,ebx
ja down
xchg eax,[esi]
down: loop up1
mov ebx,eax
call disp_proc ;Displaying the largest number
mov eax,1
mov ebx,0
int 80h
;************************Display Procedure****************
disp_proc: ;Code for Displaying the Number
mov ecx,08
mov esi,dispbuff
up: rol ebx,04
mov al,bl
and al,0fh
cmp al,09
jbe add30
add al,07h
add30: add al,30h
mov [esi],al
inc esi
loop up
mov eax,4
mov ebx,1
mov ecx,dispbuff
mov edx,08
int 80h
ret
array dd 50000000h,88000000h,66000000h,96326100h,63298541h
arrcnt equ 05
max db "Maximum Number is="
maxlen equ $-max
section .bss
dispbuff resb 02
section .text
global _start
_start:
mov eax,4 ;Printing sum
mov ebx,1
mov ecx,max
mov edx,maxlen
int 80h
mov esi,array
mov ecx,arrcnt
dec ecx
mov eax,[esi]
up1: add esi,4
mov ebx,[esi]
cmp eax,ebx
ja down
xchg eax,[esi]
down: loop up1
mov ebx,eax
call disp_proc ;Displaying the largest number
mov eax,1
mov ebx,0
int 80h
;************************Display Procedure****************
disp_proc: ;Code for Displaying the Number
mov ecx,08
mov esi,dispbuff
up: rol ebx,04
mov al,bl
and al,0fh
cmp al,09
jbe add30
add al,07h
add30: add al,30h
mov [esi],al
inc esi
loop up
mov eax,4
mov ebx,1
mov ecx,dispbuff
mov edx,08
int 80h
ret
Blogger Comment
Facebook Comment