For a one digit number, I want to know if it's odd or even (multiple of 2). For example, given 9, print that is an odd number.
(i.e. check the mathematical parity, not the computing parity.)
This is what I have:
assume cs:cseg,ds:dseg,ss:sseg
cseg segment
start:
mov ax, dseg
mov ds, ax
mov ah, 01h ; Here, im adding a number
int 21h
jp even
jnp odd
even:
mov ah,09
lea dx,par
int 21h
jmp exit
odd:
mov ah,09
lea dx,odd1
int 21h
jmp salir
salir:
mov ax,4C00h
int 21h
cseg ends
dseg segment byte
even Db 'Even number$'
odd11 Db 'Odd number$'
dseg ends
sseg segment stack
db 100h dup(?)
sseg ends
end start
test eax, 1
– Bifarious