0% found this document useful (0 votes)
41 views1 page

Prog 14

Uploaded by

api-3705912
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views1 page

Prog 14

Uploaded by

api-3705912
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

##################################################

#########################

Program for separating values into 2 arrays of even and odd parity

##################################################
#########################

.aseg value,data
.org 30h
even .dsb 5 ;Even parity array
odd .dsb 5 ;Odd parity array
.rseg kish,code
mov dptr,#bin ;Move numbers into dptr
mov r2,#05h ;Move number of values into R2
mov r0,#even ;R0 pointing to Even array
mov r1,#odd ;R1 pointing to Odd array
loop:
mov a,#05h
subb a,r2 ;Getting index into A
movc a,@a+dptr ;Getting number into A
jnb acc.7,evenp ;Checking parity
mov @r1,a ;Moving into odd parity array
inc r1
jmp fin
evenp:
jnb psw.0,nope
setb acc.7
nope:
mov @r0,a ;Moving into even parity
inc r0
fin:
djnz r2,loop
nop
nop
bin .db1 34h,56h,78h,96h,65h
.end

You might also like