check parity of 8-bit number Assembly Program
See Also: Check Parity of 32-bit Number Assembly Program
Check Parity of 16-bit Number Assembly Program
Check Parity of 8 -bit Number Assembly Program
include irvine32.inc
.data
num byte 122
msg byte "Parity Flag is set : PF=EVEN ",0,13h,10h
msg1 byte "Parity flag is clear : PF=ODD ",0,13h,10h
.code
main proc
call clrscr
call crlf
mov al,num
call writebin
XOR al,0
cmp al,0
JP L1
JNP L2
L2:
call crlf
mov edx,offset msg1
call writestring
jmp e
L1:
call crlf
mov edx,offset msg
call writestring
jmp e
e:
exit
main endp
end main
Check Parity of 16-bit Number Assembly Program
Check Parity of 8 -bit Number Assembly Program
include irvine32.inc
.data
num byte 122
msg byte "Parity Flag is set : PF=EVEN ",0,13h,10h
msg1 byte "Parity flag is clear : PF=ODD ",0,13h,10h
.code
main proc
call clrscr
call crlf
mov al,num
call writebin
XOR al,0
cmp al,0
JP L1
JNP L2
L2:
call crlf
mov edx,offset msg1
call writestring
jmp e
L1:
call crlf
mov edx,offset msg
call writestring
jmp e
e:
exit
main endp
end main
Post a Comment