From: ceb Date: Tue, 4 Jan 2005 22:42:16 +0000 (+0000) Subject: small changes to compile X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=7b209f99ab8ffbe680cbf10e6b3c7e06f71ad4b6;p=trains.git small changes to compile --- diff --git a/cebpic/Makefile b/cebpic/Makefile index aded8fc..11620f4 100644 --- a/cebpic/Makefile +++ b/cebpic/Makefile @@ -1,4 +1,4 @@ -PROGRAMS= led-flash send-serial reply-serial +PROGRAMS= led-flash send-serial reply-serial nmra-stream include ../pic.make diff --git a/cebpic/nmra-stream.asm b/cebpic/nmra-stream.asm index c799e8c..39bbb4a 100644 --- a/cebpic/nmra-stream.asm +++ b/cebpic/nmra-stream.asm @@ -183,10 +183,10 @@ interrupt_low ;**************************************************************************** serial_receive - movff FROMSERIAL,FSR0L ; set low byte of IND0 pointer + movff FROMSERIAL,FSR0L ; set low byte of INDF0 pointer movlw 5 - movwf FSR0H,0 ; set high byte of IND0 pointer - movff RCREG,IND0 ; copy to received register + movwf FSR0H,0 ; set high byte of INDF0 pointer + movff RCREG,INDF0 ; copy to received register incf FROMSERIAL,1,0 ; advance FROMSERIAL pointer by 1 byte ; *** check for overrun and do something sensible btfss RCREG,7,0 ; check if bit 7 is set @@ -228,7 +228,7 @@ timer0_interrupt bcf INTCON,2,0 ; clear interrupt-set bit movlw 0x01 ; (testing) ; movlw 0x6E ; (not-testing) - movwf W,TMR0L ; set timer0 to 0x6E (so interrupt takes 58us) + movwf TMR0L,0 ; set timer0 to 0x6E (so interrupt takes 58us) ; check next action - if 0, change to 1 and return @@ -263,7 +263,7 @@ decide_next_bit ; check whether current to-track buffer = current from-serial buffer ; if yes, transmit 1s (set transmitbit=1, nextaction=1 and return) - movff FROMSERIAL,W,0 + movff FROMSERIAL,W xorwf TOTRACK,0,0 andlw 0x30 bnz read_from_buffer @@ -287,7 +287,7 @@ read_from_buffer movff TOTRACK,FSR1L ; set low byte of IND1 pointer movlw 5 movwf FSR1H,0 ; set high byte of IND1 pointer - movff INDF1,W,0 + movff INDF1,W andwf TOTRACKBIT,0,0 ; mask out bit to be transmitted ;*** to `mask out' means to clear, eg ;*** if you were to `mask out bit 0 of 0xff' you'd get 0xfe @@ -331,7 +331,7 @@ advance_pointer movff TOTRACK,FSR1L movlw 5 movwf FSR1H,0 - movff INDF1,W,0 + movff INDF1,W andlw 0x80 ;*** bit test bit 7 of INDF1 ? That's simpler than load into W and AND. -iwj @@ -384,7 +384,7 @@ advance_read_byte movff TOTRACK,FSR1L ; set low byte of IND1 pointer movlw 5 movwf FSR1H,0 ; set high byte of IND1 pointer - movff INDF1,W,0 + movff INDF1,W andwf TOTRACKBIT,0,0 ; mask out bit to be transmitted ;*** This is the same code as the 2nd stanza in read_from_buffer, ;*** above. Surely it should be made common (eg a subroutine) ? -iwj diff --git a/detpic/nmra-stream.asm b/detpic/nmra-stream.asm index c799e8c..39bbb4a 100644 --- a/detpic/nmra-stream.asm +++ b/detpic/nmra-stream.asm @@ -183,10 +183,10 @@ interrupt_low ;**************************************************************************** serial_receive - movff FROMSERIAL,FSR0L ; set low byte of IND0 pointer + movff FROMSERIAL,FSR0L ; set low byte of INDF0 pointer movlw 5 - movwf FSR0H,0 ; set high byte of IND0 pointer - movff RCREG,IND0 ; copy to received register + movwf FSR0H,0 ; set high byte of INDF0 pointer + movff RCREG,INDF0 ; copy to received register incf FROMSERIAL,1,0 ; advance FROMSERIAL pointer by 1 byte ; *** check for overrun and do something sensible btfss RCREG,7,0 ; check if bit 7 is set @@ -228,7 +228,7 @@ timer0_interrupt bcf INTCON,2,0 ; clear interrupt-set bit movlw 0x01 ; (testing) ; movlw 0x6E ; (not-testing) - movwf W,TMR0L ; set timer0 to 0x6E (so interrupt takes 58us) + movwf TMR0L,0 ; set timer0 to 0x6E (so interrupt takes 58us) ; check next action - if 0, change to 1 and return @@ -263,7 +263,7 @@ decide_next_bit ; check whether current to-track buffer = current from-serial buffer ; if yes, transmit 1s (set transmitbit=1, nextaction=1 and return) - movff FROMSERIAL,W,0 + movff FROMSERIAL,W xorwf TOTRACK,0,0 andlw 0x30 bnz read_from_buffer @@ -287,7 +287,7 @@ read_from_buffer movff TOTRACK,FSR1L ; set low byte of IND1 pointer movlw 5 movwf FSR1H,0 ; set high byte of IND1 pointer - movff INDF1,W,0 + movff INDF1,W andwf TOTRACKBIT,0,0 ; mask out bit to be transmitted ;*** to `mask out' means to clear, eg ;*** if you were to `mask out bit 0 of 0xff' you'd get 0xfe @@ -331,7 +331,7 @@ advance_pointer movff TOTRACK,FSR1L movlw 5 movwf FSR1H,0 - movff INDF1,W,0 + movff INDF1,W andlw 0x80 ;*** bit test bit 7 of INDF1 ? That's simpler than load into W and AND. -iwj @@ -384,7 +384,7 @@ advance_read_byte movff TOTRACK,FSR1L ; set low byte of IND1 pointer movlw 5 movwf FSR1H,0 ; set high byte of IND1 pointer - movff INDF1,W,0 + movff INDF1,W andwf TOTRACKBIT,0,0 ; mask out bit to be transmitted ;*** This is the same code as the 2nd stanza in read_from_buffer, ;*** above. Surely it should be made common (eg a subroutine) ? -iwj