assembly code to count odd and even in list
DATA SEGMENT
A DW 1,2,3,4,5,6,7,8,9,10
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA SI,A
MOV DX,0000
MOV BL,02
MOV CL,10
L1:MOV AX,WORD PTR[SI]
DIV BL
CMP AH,00
JNZ L2
INC DH
JMP L3
L2:INC DL
L3:
ADD SI,2
DEC CL
CMP CL,00
JNZ L1
MOV AH,4CH
INT 21H
CODE ENDS
END START
;OUTPUT:->
;-G CS: 0029
;
;AX=0005 BX=0002 CX=0000 DX=0505 SP=0000 BP=0000 SI=0014 DI=0000
;DS=0BF4 ES=0BE4 SS=0BF4 CS=0BF6 IP=0029 NV UP EI PL ZR NA PE NC
;0BF6:0029 B44C MOV AH,4C