chiark / gitweb /
use BUFFERPAGE constant instead of literal 5
authorian <ian>
Sun, 9 Jan 2005 21:43:37 +0000 (21:43 +0000)
committerian <ian>
Sun, 9 Jan 2005 21:43:37 +0000 (21:43 +0000)
cebpic/nmra-stream.asm
detpic/nmra-stream.asm

index 5909e5628acf23cf77da2f78eac2edacf85594a0..31697e8ca750072a39dde55d93e7c8a5a8e7881a 100644 (file)
@@ -15,6 +15,8 @@ FROMSERIAL    equ     0x1     ; byte 1: from-serial buffer location (in BSR5)
 TOTRACK                equ     0x2     ; byte 2: to-track buffer location (in BSR5)
 TOTRACKBIT     equ     0x3     ; byte 3: bit location of pointer within byte
 
+BUFFERPAGE     equ     5
+
 
        ifdef   SLOW_VERSION
        messg   "hello this is the slow version"
@@ -139,12 +141,12 @@ initialise
 
 ; initialise buffers (for BSR5, for nmra from-serial/to-track buffers)
 
-       movlw   5
-       movwf   BSR,0           ; set BSR to 5
+       movlw   BUFFERPAGE
+       movwf   BSR,0           ; set BSR to point to buffer page
 
        clrf    NMRACTRL,0      ; for bits relevant to control of nmra stream
-       clrf    FROMSERIAL,0    ; for loc'n of write-from-usart ptr within BSR5
-       clrf    TOTRACK,0       ; for loc'n of send-to-track ptr within BSR5
+       clrf    FROMSERIAL,0    ; for loc'n of write-from-usart ptr in buffers
+       clrf    TOTRACK,0       ; for loc'n of send-to-track ptr in buffers
                                ; all in access bank
 
 
@@ -227,7 +229,7 @@ interrupt_low
 serial_receive
 ;      debug   'h'     ; write 'h' to serial port
        movff   FROMSERIAL,FSR0L        ; set low byte of INDF0 pointer
-       movlw   5
+       movlw   BUFFERPAGE
        movwf   FSR0H,0                 ; set high byte of INDF0 pointer
 ;      debug   '1'     ; write 'h' to serial port
        movff   RCREG,INDF0             ; copy to received register
@@ -348,7 +350,7 @@ read_from_buffer
 
        debug   'p'
        movff   TOTRACK,FSR1L           ; set low byte of IND1 pointer
-       movlw   5
+       movlw   BUFFERPAGE
        movwf   FSR1H,0                 ; set high byte of IND1 pointer
        movff   INDF1,WREG
        andwf   TOTRACKBIT,0,0          ; select bit to be transmitted
@@ -397,7 +399,7 @@ advance_pointer
 ; currently on bit 7 of the byte, after having read rest of byte to
 ; track; check whether it is 1 or 0
        movff   TOTRACK,FSR1L   
-       movlw   5
+       movlw   BUFFERPAGE
        movwf   FSR1H,0         
 
 ; if set, move to next buffer
index 5909e5628acf23cf77da2f78eac2edacf85594a0..31697e8ca750072a39dde55d93e7c8a5a8e7881a 100644 (file)
@@ -15,6 +15,8 @@ FROMSERIAL    equ     0x1     ; byte 1: from-serial buffer location (in BSR5)
 TOTRACK                equ     0x2     ; byte 2: to-track buffer location (in BSR5)
 TOTRACKBIT     equ     0x3     ; byte 3: bit location of pointer within byte
 
+BUFFERPAGE     equ     5
+
 
        ifdef   SLOW_VERSION
        messg   "hello this is the slow version"
@@ -139,12 +141,12 @@ initialise
 
 ; initialise buffers (for BSR5, for nmra from-serial/to-track buffers)
 
-       movlw   5
-       movwf   BSR,0           ; set BSR to 5
+       movlw   BUFFERPAGE
+       movwf   BSR,0           ; set BSR to point to buffer page
 
        clrf    NMRACTRL,0      ; for bits relevant to control of nmra stream
-       clrf    FROMSERIAL,0    ; for loc'n of write-from-usart ptr within BSR5
-       clrf    TOTRACK,0       ; for loc'n of send-to-track ptr within BSR5
+       clrf    FROMSERIAL,0    ; for loc'n of write-from-usart ptr in buffers
+       clrf    TOTRACK,0       ; for loc'n of send-to-track ptr in buffers
                                ; all in access bank
 
 
@@ -227,7 +229,7 @@ interrupt_low
 serial_receive
 ;      debug   'h'     ; write 'h' to serial port
        movff   FROMSERIAL,FSR0L        ; set low byte of INDF0 pointer
-       movlw   5
+       movlw   BUFFERPAGE
        movwf   FSR0H,0                 ; set high byte of INDF0 pointer
 ;      debug   '1'     ; write 'h' to serial port
        movff   RCREG,INDF0             ; copy to received register
@@ -348,7 +350,7 @@ read_from_buffer
 
        debug   'p'
        movff   TOTRACK,FSR1L           ; set low byte of IND1 pointer
-       movlw   5
+       movlw   BUFFERPAGE
        movwf   FSR1H,0                 ; set high byte of IND1 pointer
        movff   INDF1,WREG
        andwf   TOTRACKBIT,0,0          ; select bit to be transmitted
@@ -397,7 +399,7 @@ advance_pointer
 ; currently on bit 7 of the byte, after having read rest of byte to
 ; track; check whether it is 1 or 0
        movff   TOTRACK,FSR1L   
-       movlw   5
+       movlw   BUFFERPAGE
        movwf   FSR1H,0         
 
 ; if set, move to next buffer