Hi I wrote this assembly code in order to print string hai 10 times by initialising register cl with 10 and by decrimenting it by dec ,and checking whether it cross zero in using JNE instruction.But i found that the loop is not terminating.why here cl not become zero and why loop is not terminating? code is below
segment .text
global _start
_start :
mov cl,0xa ;counter set to 10
L1:
;printing message
mov eax,4
mov ebx,1
mov ecx,msg
mov edx,len
int 80h
dec cl ;decrimenting the counter
cmp cl,0x0 ;compare if counter reach zero
jne L1 ;if counter not reached zero rotate in loop
mov eax,1
mov ebx,0
int 80h
section .data
msg db "hai",0xa
len equ $- msg