global _start
_start :

section .text

%macro disp_macro 2
mov rax,1
mov rdi,1
mov rsi,%1
mov rdx,%2
syscall
%endm


disp_macro msg1,len1
mov rsi,sarr
l1:mov al,[rsi]
push rsi
call display
disp_macro msg3,len3
pop rsi
inc rsi
dec byte[cnt]
jnz l1

mov rsi,sarr
mov rdi,darr
l2:mov al,[rsi]
mov [rdi],al
inc rsi
inc rdi
dec byte[cnt1]
jnz l2


disp_macro msg2,len2
mov rsi,darr
l3:mov al,[rsi]
push rsi
call display
disp_macro msg4,len4
pop rsi
inc rsi
dec byte[cnt2]
jnz l3



%macro exitm 0
mov rax,60
mov rdi,0
syscall
%endm

exitm



display:
mov rsi,disparr+1
mov rcx,02

a2:mov rdx,0
mov rbx,10H
div rbx
cmp dl,09H
jbe a1
add dl,07h

a1:add dl,30H
mov[rsi],dl
dec rsi
dec rcx
jnz a2

mov rax,1
mov rdi,1
mov rsi,disparr
mov rdx,02
syscall

ret



section .data
msg1 db "The source Array is: ",0Ah
len1 equ $-msg1

msg3 db "",0Ah
len3 equ $-msg3

sarr db 01h,02h,03h,04h,05h,06h,07h,08h,09h,0Ah

msg2 db "the destination array is ",0Ah
len2 equ $-msg2

msg4 db "",0Ah
len4 equ $-msg4

darr db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h
cnt1 db 0AH
cnt db 0AH
cnt2 db 0AH




section .bss
disparr resb 64

Embed on website

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