This commit is contained in:
Dennis Gunia
2022-12-16 20:45:34 +01:00
parent aabf475b67
commit bc1b9a399d
40 changed files with 13208 additions and 5377 deletions

View File

@@ -0,0 +1,16 @@
; a contains data
; bc destroied
; carry is set if odd, reset if even
calc_parity:
ld c,0 ;parity data
ld b,8 ;bit counter
calc_parity_loop:
rrca
jr nc,calc_parity_loop_2 ;if not zero then skip increment
inc c
calc_parity_loop_2:
djnz calc_parity_loop
ld a,c
rra ;carry is set to bit 0 of high-counter.
;if bit1 is set -> odd # of 1s else even # of 1s
ret