Hi I have a 14 bit number I'm right shift this number 6 times (divide by 64).
But when i right shift i need to make a fraction byte which is goes to the carry (without discarding LSB).
Can somebody help me to make a fraction byte using this system.
I'm doing this to detect the final result is a half divide or fully divide one.
So looking at the fraction byte i can detect that.
Ex:26.5,31.5 etc.....
But when i right shift i need to make a fraction byte which is goes to the carry (without discarding LSB).
Can somebody help me to make a fraction byte using this system.
I'm doing this to detect the final result is a half divide or fully divide one.
So looking at the fraction byte i can detect that.
Ex:26.5,31.5 etc.....
Code:
Divide bcf STATUS,C
rrf TotalH,F
rrf TotalL,F ;divide by 2
bcf STATUS,C
rrf TotalH,F
rrf TotalL,F ;divide by 4
bcf STATUS,C
rrf TotalH,F
rrf TotalL,F ;divide by 8
bcf STATUS,C
rrf TotalH,F
rrf TotalL,F ;divide by 16
bcf STATUS,C
rrf TotalH,F
rrf TotalL,F ;divide by 32
bcf STATUS,C
rrf TotalH,F
rrf TotalL,F ;divide by 64