global _start
_start:

section .text

mov rsi,arr ; rsi is pointing to the arr
back1:mov rax,[rsi] ;fetching the elements
bt rax,63
jc n1

inc byte[pcnt]
jmp next
n1:inc byte[ncnt]

next:add rsi,8
dec byte[cnt]
jnz back1

mov rax,1
mov rdi,1
mov rsi,msg3
mov rdx,len3
syscall

mov rax,[pcnt]
call display

mov rax,1
mov rdi,1
mov rsi,msg4
mov rdx,len4
syscall

mov rax,[ncnt]
call display

mov rax,60
mov rdi,0
syscall

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

l3:mov rdx,0
mov rbx,10H

div rbx
cmp DL,09H
jbe l2

add DL,07H
l2:add DL,30H

mov[rsi],DL
dec rsi
dec rcx
jnz l3

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

mov rax,1
mov rdi,1
mov rsi,endc
mov rdx,lenendc

syscall
ret

section .data

arr dq 1234567812345678H, 9876543223456789H, 2222222222222222H, 8787878787878787H, 6969696969696969H, 4444555666677888H, 3333224455667745H, 9988776687098764H, 4343656789087345H, 1111557689003344H, 7788556643569085H 

cnt db 0bH
msg3 db "POSITIVE COUNT: "
len3 equ $-msg3
msg4 db "NEGATIVE COUNT: "
len4 equ $-msg4

endc db 0ah
lenendc equ $-endc

section .bss
disparr resb 32
pcnt resb 10
ncnt resb 10

Embed on website

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