global _start
_start:

;macros
%macro sysread 2
	mov rax,0
	mov rdi,0
	mov rsi,%1
	mov rdx,%2
	syscall
%endmacro

%macro dispmsg 2
	mov rax,1
	mov rdi,1
	mov rsi,%1
	mov rdx,%2
	syscall
%endmacro

%macro sysexit 0
	mov rax,60
	mov rdi,0
	syscall
%endmacro

;-------------section .text--------------------------------------
section .text
dispmsg msg1,len1
mov rdi,array
back:
push rdi

sysread num,16

mov rdi,temp
mov rdi,temp+07
mov rsi,num
mov rcx,08
bk:
mov al,[rsi]
cmp al,39h
jbe l4
sub al,07h
l4: sub al,30h
ROL al,04h
mov bl,al
inc rsi
mov al,[rsi]
cmp al,39h
jbe l5
sub al,07h
l5: sub al,30h
add al,bl
mov [rdi],al
dec rdi

inc rsi

loop bk
pop rdi
mov rax,[temp]
mov [rdi],rax
add rdi,8
dec byte[cnt]
jnz back
dispmsg msg3,len3
mov rsi,array
b1:
push rsi
mov rax,[rsi]

;call display procedure of 16 digits
call display
dispmsg msg2,len2
pop rsi
add rsi,8
dec byte[arraycnt]
jnz b1

exit:
dispmsg thanks,lThanks
sysexit




;display procedure for 16 digits
display:
mov rsi,arr+15
mov rcx,16
l6: mov rdx,0
mov rbx,10h
div rbx
cmp dl,09h	
jbe n1		
add dl,07h
n1: add dl,30h
mov [rsi],dl
dec rsi	
dec rcx		
jnz l6		
dispmsg arr,16
ret	
;--------------------------------------
section .data
msg1 db 10,"Enter five 64-bit Hex Numbers  ",10
len1 equ $-msg1
msg2 db 10," "
len2 equ $-msg2
msg3 db 10,"The five 64-bit Hex Numbers are : ",10
len3 equ $-msg3
thanks db 10,10,"Thank you for using this program!!!",10,10
lThanks equ $-thanks
nLine db 10
lnLine equ $-nLine
arraycnt db 05
cnt db 05
array dq 0h,0h,0h,0h,0h
temp dq 0h,0h,0h,0h,0h
;--------------------------------------
section .bss
 arr resb 32
num resb 16
no resb 3

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: