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,arr2
label3: 
mov rax,[rsi]
push rsi
call display

disp_macro msg2,len2

pop rsi
add rsi,8
dec byte[cnt]
jnz label3

mov rsi,arr2
label5:bt qword[rsi],63
jc label4
inc byte[pcnt]
jmp next
label4:inc byte[ncnt]

next:add rsi,8
dec byte[cnt1]
jnz label5

disp_macro msg3,len3
mov ah,00
mov al,[pcnt]
call display
disp_macro msg2,len2
disp_macro msg4,len4
mov ah,00
mov al,[ncnt]
call display
disp_macro msg2,len2

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

exitm

display:
mov rsi,disparr+15
mov rcx,16

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,16
syscall

ret

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

arr2 dq 9234567812345679h,1224567812245678h,3214567812345678h,1223367812345678h,8765432187654321h
cnt db 05H
cnt1 db 05H

msg2 db " ",0Ah
len2 equ $-msg2


msg3 db "the positive number are ",0Ah
len3 equ $-msg3


msg4 db "the negative number are",0Ah
len4 equ $-msg4

section .bss
disparr resb 20
pcnt resb 2
ncnt resb 2

Embed on website

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