As the title states, I'm using assembly language to try to get a text to move left to right 5 times. I've pasted my code below. As of right now, what happens is it moves left to right 4 and a half times, starts over at the very left and it repeats infinity times. I feel like the error lies on where I placed my pop cx. I hope that maybe someone else can see the mistake and I just missed it.
.model small
.stack
.data
strg db 'Test$'
row db 12
col db 0
.code
main proc
mov ax,@data
mov ds,ax
dem: mov cx,5
push cx
mov cx,79
again: push cx ;clears the terminal
mov ah,6
mov al,0
mov bh,7
mov ch,0
mov cl,0
mov dh,24
mov dl,79
int 10h
mov ah,2
mov bh,0
mov dh,row ;row
mov dl,col ;col
int 10h
mov ah,9
mov dx, offset strg ;prints the text
int 21h
inc col
mov cx,1 ;x and y adds delay
y: push cx
mov cx,0ffffh
x: loop x
pop cx
loop y
pop cx
loop again
pop cx
loop dem
mov ah,4ch
int 21h
main endp
end main