0% found this document useful (0 votes)
31 views2 pages

EXPT 4 - To Find Largest of Given Number.

The document provides an assembly language program for the X86/64 architecture that finds the largest number from a given array of Byte/Word/Doubleword/64bit numbers. It initializes an array with three hexadecimal values and uses a loop to compare each value, updating the maximum found. The program then formats and prints the maximum number to the console.

Uploaded by

karan.ppjgk22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

EXPT 4 - To Find Largest of Given Number.

The document provides an assembly language program for the X86/64 architecture that finds the largest number from a given array of Byte/Word/Doubleword/64bit numbers. It initializes an array with three hexadecimal values and uses a loop to compare each value, updating the maximum found. The program then formats and prints the maximum number to the console.

Uploaded by

karan.ppjgk22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment No.

4
Write an X86/64 ALP to find the largest of given Byte/Word/Doubleword/64bit
numbers.

section .data
welmsg db 10, 'The maximum number in the array is :',
len1 equ $-welmsg
array dQ 8abc123456781234h, 90ff123456781234h,7700123456781234h
arrcnt equ 3
section .bss
dispbuff resb 2
buf resb 16
%macro print 2
mov eax,4
mov ebx, 1
mov ecx, %1
mov edx, %2
int 0X80
%endmacro

section .text
global _start
_start:
print welmsg, len1
mov esi, array
mov rax, [esi]
mov ecx, arrcnt
up1:
add esi, 8
mov rbx, [esi]
cmp rax, rbx
jnc skip
mov rax, rbx
mov edi, buf
skip:
loop up1
mov rbx, rax
mov edi, buf
mov ecx, 16
dispup1:
rol rbx, 4
mov dl, bl
and dl, 0fh
add dl, 30h
cmp dl, 39h
jbe dispskip1
add dl, 07h
dispskip1:
mov [edi], dl
inc edi
loop dispup1
print buf, 16
ret

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy