progress on FAT16 support
This commit is contained in:
16
OperatingSystem/monitor_v2/include/.old/parity.s
Normal file
16
OperatingSystem/monitor_v2/include/.old/parity.s
Normal 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
|
||||
Reference in New Issue
Block a user