'How to delete several rows in a matrix?

The task is to delete rows with zero elements. So, I have this code:

    mov incr, 0
    mov bx, 0
    mov cx, 0
    mov cl, rowsnum
    processexternal:
        mov cl, colsnum
        processinternal:
            cmp matrix[bx], 0 ;compare element to 0
            ;delete row
                    
            inc bx
            
            loop processinternal
        call printnewstr
        mov cl, rowsnum
        mov si, incr
        sub cx, si
        inc incr
        loop processexternal

Here is an iteration on the elements of the matrix. What code should I add?

I think I must have missing something..



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source