Hi, I will mark below the errors and a suggestion for the correction. Regards, Imre On Mon, 11 Oct 1999, Fansler, David wrote: > I sent this plea for help to Tech-Tools on Oct. 7, 1999 - but have not heard > back from them. Anyone (left) on the pic list got any ideas? I am using > ver 4.02 of their TDE and their CVASM16 > > ____________________________________________________________________________ > ________ > I am in the process of writing my first true PIC assembler program, and hate > to bother you but I seem to have a problem. The code so far is: > > device pic16c74A,xt_osc,wdt_off,protect_off > org 00 > goto Start > org 05h > Start > ;* Set Up Ports > bcf STATUS, RP0 ;set to bank 0 ;Instead: bcf RP0 > bcf STATUS, RP1 ; bcf RP1 > clrf PORTA ;clear all ouput latches > clrf PORTB ;clear all output latches > clrf PORTC ;clear all output latches > clrf PORTD ;clear all output latches > clrf PORTE ;clear all output latches > bsf STATUS, STATUS.5 ;set to bank 1 ; Uugh! It shows you misunterstand! Status.5 also contains the status ;address, such way it is completely confused. There are two good variants: ; either: bsf STATUS.5 ;or (I prefer the former) bsf STATUS,5 > movlw 00000111b ;data to set PA0-PA2 as inputs > movwf TRISA ;set up port A > movlw 11111100b ;data to set PB0-PB1 to inputs > movwf TRISB ;set up Port B > movlw 10010111b ;data to set PC0-PC2, PC5, PC7 to > inputs > movwf TRISC ;set up Port C > movlw 11111111b ;data to set PD0-PD7 to > inputs > movwf TRISD ;set up Port D > movlw 00000000b ;data to set PE0-PE2 as outputs > movwf TRISE ;set up Port E > end > > Actually there are comments before the code and a bunch of retlw between the > movwf TRISE and the end statement. The code built cleanly before adding the > code to set up the ports. The problem is that the assembler is not > recognizing the RP0 and RP1 symbols. I tried a couple of others and they > failed also. The error messages are: > > ERROR TSAIL.SRC 188 : bit number must bee from 0 to 7 > ERROR TSAIL.SRC 189 : bit number must bee from 0 to 7 > ERROR TSAIL.SRC 195 : bit number must bee from 0 to 7 > > Where "bcf STATUS, RP0 ;set to bank 0 " is line 188 > > I did an assembly with the /D option and the symbol table listed : > STATUS=0003, RP0=5003 & RP1=6003 so the symbols seem to be there, but > contain more bits than needed. The listing notes that subsets of a label > include the primary label value. So where RP0 is bit 5 of the STATUS > register, it has a value of 5003. > > Any help would be appreciated. > > David V. Fansler > Network Administrator > TriPath Imaging, Inc. (Formerly AutoCyte, Inc) > 336-222-9707 Ext. 261 > dfansler@autocyte.com > Now Showing! www.mindspring.com/~dfansler > Updated September 23, 1999 > >