chiark / gitweb /
move copybits macro into own file
authorian <ian>
Thu, 28 Oct 2004 00:01:20 +0000 (00:01 +0000)
committerian <ian>
Thu, 28 Oct 2004 00:01:20 +0000 (00:01 +0000)
iwjpictest/copybits.asm
iwjpictest/onecopybit.inc [new file with mode: 0644]

index 2efab6be2ceb811f1e2bd0274626062e37c3e5db..be1ce03bcdb9771693bf2503212cc7f867eb3605 100644 (file)
@@ -9,6 +9,7 @@
 ;   * leaves all other pins set to their default states (usually Z).
 
        include         /usr/share/gputils/header/p18f458.inc
+       include         onecopybit.inc
 
 ACCSFR         equ             0x0f00
 
@@ -43,23 +44,6 @@ delayouter_loop
 
 delayinner_loop
 
-copybit_mi macro sourcereg, sourcebitno, destreg, destbitvals, xorinv
-       movf    destreg, 0, 0                   ; read output latch
-       andlw   ~destbitvals                    ; mask out output bit
-       btfsc   sourcereg, sourcebitno, 0       ; skip if input clear
-       iorlw   destbitvals                     ;    add output bit
-       xorlw   xorinv                          ; invert?
-       movwf   destreg, 0                      ; write output latch
-       endm                                            ; (6cy total)
-
-copybiti macro sreg, sbitno, dreg, dbitvals
-       copybit_mi      sreg, sbitno, dreg, dbitvals, dbitvals
-       endm
-
-copybit macro sreg, sbitno, dreg, dbitvals
-       copybit_mi      sreg, sbitno, dreg, dbitvals, 0
-       endm
-
        copybiti        PORTB, 5, TRISA, 0x06           ; C enable
        copybit         PORTB, 4, LATA,  0x06           ; C data
        copybiti        PORTB, 3, TRISA, 0x18           ; B enable
diff --git a/iwjpictest/onecopybit.inc b/iwjpictest/onecopybit.inc
new file mode 100644 (file)
index 0000000..eb40214
--- /dev/null
@@ -0,0 +1,18 @@
+; macro for copying bits about
+
+copybit_mi macro sourcereg, sourcebitno, destreg, destbitvals, xorinv
+       movf    destreg, 0, 0                   ; read output latch
+       andlw   ~destbitvals                    ; mask out output bit
+       btfsc   sourcereg, sourcebitno, 0       ; skip if input clear
+       iorlw   destbitvals                     ;    add output bit
+       xorlw   xorinv                          ; invert?
+       movwf   destreg, 0                      ; write output latch
+       endm                                            ; (6cy total)
+
+copybiti macro sreg, sbitno, dreg, dbitvals
+       copybit_mi      sreg, sbitno, dreg, dbitvals, dbitvals
+       endm
+
+copybit macro sreg, sbitno, dreg, dbitvals
+       copybit_mi      sreg, sbitno, dreg, dbitvals, 0
+       endm