Mercurial > public > hwos_code
comparison src/compass_ops.asm @ 148:022b886eddaf
some cleanup
author | heinrichsweikamp |
---|---|
date | Wed, 06 Aug 2014 17:38:31 +0200 |
parents | fdd4e30846ae |
children | a17359244d93 |
comparison
equal
deleted
inserted
replaced
147:fdd4e30846ae | 148:022b886eddaf |
---|---|
42 movf reg_f+0,W | 42 movf reg_f+0,W |
43 subwf reg+0,W | 43 subwf reg+0,W |
44 movwf PRODL | 44 movwf PRODL |
45 movf reg_f+1,W | 45 movf reg_f+1,W |
46 subwfb reg+1,W | 46 subwfb reg+1,W |
47 rcall filter_16_common | |
48 addwf reg_f+0,F | |
49 movf PRODH,W | |
50 addwfc reg_f+1,F | |
51 ENDM | |
52 | |
53 filter_16_common: | |
47 movwf PRODH | 54 movwf PRODH |
48 | 55 |
49 bcf STATUS,C ; Copy sign bit into carry | 56 bcf STATUS,C ; Copy sign bit into carry |
50 btfsc PRODH,7 | 57 btfsc PRODH,7 |
51 bsf STATUS,C | 58 bsf STATUS,C |
55 bcf STATUS,C ; Copy sign bit into carry | 62 bcf STATUS,C ; Copy sign bit into carry |
56 btfsc PRODH,7 | 63 btfsc PRODH,7 |
57 bsf STATUS,C | 64 bsf STATUS,C |
58 rrcf PRODH,F ; 16bit shift right | 65 rrcf PRODH,F ; 16bit shift right |
59 rrcf PRODL,W | 66 rrcf PRODL,W |
60 | 67 return |
61 addwf reg_f+0,F | |
62 movf PRODH,W | |
63 addwfc reg_f+1,F | |
64 ENDM | |
65 | 68 |
66 global compass_filter | 69 global compass_filter |
67 compass_filter: | 70 compass_filter: |
68 banksel compass_DX | 71 banksel compass_DX |
69 | 72 |