include myMacro.txt

.model small
.data
	str db "Enter Integers: $"
	strOdd db "Odd: $"
	strEven db "Even: $"
	evenCtr db 0
	oddCtr db 0
	temp db 2
	temp2 db ?
	arr db 100 dup(' ')
.code
main proc far
	mov ax, @data
	mov ds, ax
	mov es, ax
_start:
	setCursor 0h,0h
	printString str
	mov di, 0
	lea bx, arr
	
	setCursor 10h, 0h
input:
	mov ax, 0
	inputNum 
	cmp al, 08h
	je back
	cmp al, 30h
	je init_output
	mov [bx+di],al
	inc di
	jmp input
back:
	backSpace
init_output:
	mov cx, di
output:
	cmp di, 0
	je _end
	isEvenOrOdd [bx+di-1]
	dec di
	loop output
_end:
	setCursor 0h, 1h
	printString strEven
	printNum evenCtr
	
	setCursor 0h, 2h
	printString strOdd
	printNum oddCtr
	setCursor 0h, 4Eh
	mov ah, 4ch
	int 21h
main endp
end main
	