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"
; 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
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
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
; 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
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"
; 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
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
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
; 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