Please help me find the issue in my assembly level code

  Kiến thức lập trình
assume cs:code, ds:data

data segment
    array dw 12h,33h,00h,0FFh
    counter db 3 dup(0)
    size equ 4
    msg db 'Odd $'
    msg1 db 'Even $'  ;Error here
    msg2 db 'Odd $'
    
         
ends data 

code segment
start:  mov ax,data
        mov ds,ax
        mov es,ax
        
        mov cx,size
        mov si, offset array
        mov di, offset counter
        std
        
iter:   mov ax,[si]
        cmp ax,00h
        
        jz zero
        jnz check
        
        add si,2
        
        loop iter
        jz print
        
zero:   inc [di]
        inc [di+1]
        
check:  shr ax,1
        jc  odd
        jnc even
        
odd:    inc [di+2]
even:   inc [di+1]

print:  mov dx, offset msg
        mov ah,09h
        int 21h
        
        mov dl,0dh
        mov ah,02
        int 21h
       
        mov dl,0ah
        mov ah,02
        int 21h
        
        mov dx, di
        mov ah,02h
        int 21h
        
        mov dl,0dh
        mov ah,02
        int 21h
       
        mov dl,0ah
        mov ah,02
        int 21h
        
        mov dx, offset msg1
        mov ah,09h
        int 21h
        
        mov dl,0dh
        mov ah,02
        int 21h
       
        mov dl,0ah
        mov ah,02
        int 21h
        
        mov dx, [di+1]
        mov ah,02h
        int 21h    
              
        mov dl,0dh
        mov ah,02
        int 21h
       
        mov dl,0ah
        mov ah,02
        int 21h
        
        mov dx, offset msg2
        mov ah,09h
        int 21h
        
        mov dl,0dh
        mov ah,02
        int 21h
        
        mov dl,0ah
        mov ah,02
        int 21h
        
        mov dx, [di+2]
        mov ah,02h
        int 21h      
        
        mov ah,4ch
        int 21h
        
ends code
ends start

I am a beginner to assembly level language programming
I am using Emu8086.

In the above code, I am trying to count no.of odd, even numbers and zeroes and display the result in dos.

The error I am facing is that(in the commented line in code) opcode not found.

I want your suggestion to improve this code.

New contributor

Anony Moose is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT