diff src/compass_ops.asm @ 148:022b886eddaf

some cleanup
author heinrichsweikamp
date Wed, 06 Aug 2014 17:38:31 +0200
parents fdd4e30846ae
children a17359244d93
line wrap: on
line diff
--- a/src/compass_ops.asm	Wed Aug 06 11:59:04 2014 +0200
+++ b/src/compass_ops.asm	Wed Aug 06 17:38:31 2014 +0200
@@ -44,6 +44,13 @@
         movwf   PRODL
         movf    reg_f+1,W
         subwfb  reg+1,W
+        rcall   filter_16_common
+        addwf   reg_f+0,F
+        movf    PRODH,W
+        addwfc  reg_f+1,F
+        ENDM
+
+filter_16_common:
         movwf   PRODH
 
         bcf     STATUS,C        ; Copy sign bit into carry
@@ -57,11 +64,7 @@
         bsf     STATUS,C
         rrcf    PRODH,F         ; 16bit shift right
         rrcf    PRODL,W
-
-        addwf   reg_f+0,F
-        movf    PRODH,W
-        addwfc  reg_f+1,F
-        ENDM
+        return
 
         global  compass_filter
 compass_filter: