Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

need guidance about error in compiling

Status
Not open for further replies.

wejos

Member
i'm using 16f84 and ran into these errors. first time to see one like this. i have no idea what's going on maybe i messed up some settings and changed by accident the default path for the "inc" files, i have no clue also where to change this setting. and it says goto, mov, call, and etc. cannot be recognized, i have this assumption that these commands or instruction set are built in. help me please lol i am lost.

the fuses that i used:


LIST p=16F84 ;tell assembler what chip we are using
include "P16F84.inc" ;include the defaults for the chip
ERRORLEVEL 0, -302 ;suppress bank selection messages
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
;sets the configuration settings (oscillator type etc.) or RC_OSC if thats what your using




Release build of project `C:\asmproj2.disposable_mcp' started.
Language tool versions: MPASMWIN.exe v5.30.01, mplink.exe v4.30.01
Tue Jan 01 07:23:52 2002
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F84 "asmproj2.asm" /l"asmproj2.lst" /e"asmproj2.err"
Warning[205] C:\ASMPROJ2.ASM 2 : Found directive in column 1. (LIST)
Warning[205] C:\ASMPROJ2.ASM 8 : Found directive in column 1. (org)
Warning[203] C:\ASMPROJ2.ASM 9 : Found opcode in column 1. (goto)
Warning[205] C:\ASMPROJ2.ASM 30 : Found directive in column 1. (org)
Warning[203] C:\ASMPROJ2.ASM 32 : Found opcode in column 1. (MOVLW)
Warning[203] C:\ASMPROJ2.ASM 33 : Found opcode in column 1. (call)
Warning[203] C:\ASMPROJ2.ASM 34 : Found opcode in column 1. (bcf)
Warning[203] C:\ASMPROJ2.ASM 35 : Found opcode in column 1. (retfie)
Error[113] C:\ASMPROJ2.ASM 222 : Symbol not previously defined (res)
Error[113] C:\ASMPROJ2.ASM 233 : Symbol not previously defined (res)
Warning[205] C:\ASMPROJ2.ASM 244 : Found directive in column 1. (res)
Error[113] C:\ASMPROJ2.ASM 244 : Symbol not previously defined (bsf)
Error[112] C:\ASMPROJ2.ASM 244 : Missing operator
Error[108] C:\ASMPROJ2.ASM 244 : Illegal character (,)
Warning[231] C:\ASMPROJ2.ASM 244 : No memory has been reserved by this instruction
Warning[205] C:\ASMPROJ2.ASM 261 : Found directive in column 1. (end)
Halting build on first failure as requested.
----------------------------------------------------------------------
 
hi,
To prevent the 'warning' messages.

add: errorlevel -302 , -207

The 'errors' must be corrected in the actual program you have written.

Post your FULL program listing use the CODE tags to enclose the listing, upper menu '#'
 
Last edited:
eric

Code:
LIST	p=16F84	                ;tell assembler what chip we are using
	include "P16F84.inc"		;include the defaults for the chip
	ERRORLEVEL	0,	-302	;suppress bank selection messages
	__CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC 
                                        ;sets the configuration settings (oscillator type etc.) or RC_OSC if thats what your using

org	0x000
goto         Initialise

Rcv_Byte     equ    0x0C     
Bit_cntr     equ    0x1C
Delay_Count  equ    0x0D
Xmit_Byte    equ    0x1D
Baf          equ    0x0E
BUF          equ    0x1E
seg          equ    0x0F
CounterC     equ    0x1F
STATUS	     equ    0x03	
PORTA	     equ    0x05	
PORTB	     equ    0x06	
TRISA	     equ    0x85	
TRISB	     equ    0x86	
INTCON       equ    0x0B 



;***************INTERRUPT ROUTINE***************

org         0x04           

MOVLW       0x7A
call        XMIT_RS232
bcf         INTCON,1
retfie                               
           
Initialise	


;*******************Set Up The Interrupt Registers****

 bsf                INTCON,7         ;GIE – Global interrupt enable (1=enable)

 bsf                INTCON,6

 bsf                INTCON,4         ;INTE - RB0 Interrupt Enable (1=enable)

 bcf                INTCON,1         ;INTF - Clear FLag Bit Just In Case

 ;*******************Set Up The Ports******************


            CLRF    	PORTA
    	    CLRF    	PORTB
	        BSF         STATUS,5    	
    	    MOVLW       b'00001001' 
            MOVWF       PORTB       
    	    BCF         STATUS,5    
    	    CALL    	SER_INIT    
Loop	    CALL    	Rcv_RS232
            MOVWF       Baf
    	    CALL        DETERMa
            CALL        DETERMb
            CALL        DETERMc
            CALL        DETERMd
            CALL        DETERMe
            CALL        DETERMf
            CALL        zegment
            CALL        xzegment
            call        numbyr
            call        mumbyrt
            BTFSC       PORTB,0X03 
            call        papereset
            goto    	Loop
 

SER_INIT
            BSF     STATUS,5        
            MOVLW   b'00010001'
            MOVWF   PORTA
            BCF     STATUS,5      
            BSF     PORTA,0X04   
            RETURN


XMIT_RS232  MOVWF   Xmit_Byte             
            MOVLW   0x08                  
            MOVWF   Bit_cntr
            BCF     PORTA, 0x01
            CALL    Bit_Delay
Ser_Loop    RRF     Xmit_Byte,f         
            BTFSS   STATUS,C
            BCF     PORTA,0x01
            BTFSC   STATUS,C
            BSF     PORTA,0x01
            CALL    Bit_Delay
            DECFSZ  Bit_cntr,f         
            GOTO    Ser_Loop
            BSF     PORTA,0x01
            CALL    Bit_Delay
            RETURN

Rcv_RS232   BTFSC   PORTA,0X04
            CALL    PANGDAMAY 
            BTFSC   PORTA, 0x00     
            GOTO    Rcv_RS232
            CALL    Start_Delay	    
            BTFSC   PORTA,0x00      
            GOTO    Rcv_RS232
            MOVLW   0x08            
            MOVWF   Bit_cntr
            CLRF    Rcv_Byte
Next_RcvBit CALL    Bit_Delay
            BTFSS   PORTA,0x00
            BCF     STATUS,C
            BTFSC   PORTA,0x00
            BSF     STATUS,C
            RRF     Rcv_Byte,f
            DECFSZ  Bit_cntr,f      
            GOTO    Next_RcvBit
            CALL    Bit_Delay
            MOVF    Rcv_Byte,W
            RETURN

Start_Delay MOVLW   0x0C
            MOVWF   Delay_Count
Start_Wait  NOP
            DECFSZ  Delay_Count,f
            GOTO    Start_Wait
            RETURN

Bit_Delay   MOVLW   0x18
            MOVWF   Delay_Count
Bit_Wait    NOP
            DECFSZ  Delay_Count,f
            GOTO    Bit_Wait
            RETURN

DETERMa     MOVF    Baf,W
            xorlw   0x61			
            btfsc   STATUS, Z
            BSF     PORTB,0x01
            RETURN

DETERMb     MOVF   Baf,W
            xorlw  0x62			
            btfsc  STATUS, Z
            BSF    PORTA,0x03
            RETURN

DETERMc     MOVF   Baf,W
            xorlw  0x63			
            btfsc  STATUS, Z
            BSF    PORTB,0x02
	        call   delay1
            bcf    PORTB,0x02            
            RETURN

DETERMd     MOVF    Baf,W
            xorlw   0x64			
            btfsc   STATUS, Z
            BSF     PORTA,0x02
            call    delay1
            bcf     PORTA,0x02              
            RETURN

DETERMe     MOVF   Baf,W
            xorlw  0x65			
            btfsc  STATUS, Z
            BCF    PORTB,0x01
            RETURN

DETERMf     MOVF   Baf,W
            xorlw  0x66			
            btfsc  STATUS, Z
            BCF    PORTA,0x03
            RETURN

papereset   MOVLW  0x76
            call   XMIT_RS232
            RETURN


PANGDAMAY   MOVLW  0x79
            call   XMIT_RS232
            RETURN

zegment     MOVF   Baf,W
            xorlw  0x78			
            btfsc  STATUS, Z
            call   sumpzeg            
            RETURN

sumpzeg     movlw   0x78
            MOVWF   seg    
            RETURN

xzegment    MOVF   Baf,W
            xorlw  0x77			
            btfsc  STATUS, Z
            call   xsumpzeg            
            RETURN

xsumpzeg    movlw   0x77
            MOVWF   seg    
            RETURN


numbyr      MOVF   seg,W
            xorlw  0x78			
            btfsc  STATUS, Z            
            call   numbo
            RETURN

mumbyrt     MOVF   seg,W
            xorlw  0x77			
            btfsc  STATUS, Z            
            call   numbt
            RETURN
         

numbo       call    res
bark        bsf	    PORTB,6
    	    call    delay1
    	    bcf     PORTB,6
            decfsz  Baf,1        
            goto    bark
            bcf     PORTB,6 
            movlw   0x00
            MOVWF   seg
            RETURN

numbt       call    res
burk        bsf	    PORTB,7
    	    call    delay1
    	    bcf     PORTB,7
            decfsz  Baf,1        
            goto    burk
            bcf     PORTB,7 
            movlw   0x00
            MOVWF   seg
            RETURN

res         bsf     PORTB,5
            call    delay1
            bcf     PORTB,5
            bsf     PORTB,4
            call    delay1
            bcf     PORTB,4
            RETURN
  

delay1:	
;PIC Time Delay = 0.50000200 s with Osc = 4000000 Hz
		movlw	D'5'
		movwf	CounterC
		
loopp	decfsz	CounterC,1
		goto	loopp
		retlw	0	 
end
 
ok lol looks that way

hi
It now compiles.
DONT use 'res' as a LABEL its a reserved instruction.
I have changed it to res1.

Also dont locate 'org' 'end' at the start of a line, tab in first. OK:)

Also you dont need to define these registers, the include "P16F84.inc" gets the job done.
STATUS equ 0x03
PORTA equ 0x05
PORTB equ 0x06
TRISA equ 0x85
TRISB equ 0x86
INTCON equ 0x0B



Code:
	LIST	p=16F84	                ;tell assembler what chip we are using
	include "P16F84.inc"		;include the defaults for the chip
	ERRORLEVEL	0,	-302, -207	;suppress bank selection messages
	__CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC 
                                        ;sets the configuration settings (oscillator type etc.) or RC_OSC if thats what your using

	org	0x000
	goto         Initialise

Rcv_Byte     equ    0x0C     
Bit_cntr     equ    0x1C
Delay_Count  equ    0x0D
Xmit_Byte    equ    0x1D
Baf          equ    0x0E
BUF          equ    0x1E
seg          equ    0x0F
CounterC     equ    0x1F



STATUS	     equ    0x03	
PORTA	     equ    0x05	
PORTB	     equ    0x06	
TRISA	     equ    0x85	
TRISB	     equ    0x86	
INTCON       equ    0x0B 



;***************INTERRUPT ROUTINE***************

	org         0x04           

	MOVLW       0x7A
	call        XMIT_RS232
	bcf         INTCON,1
	retfie                               
           
Initialise	


;*******************Set Up The Interrupt Registers****

 bsf                INTCON,7         ;GIE – Global interrupt enable (1=enable)

 bsf                INTCON,6

 bsf                INTCON,4         ;INTE - RB0 Interrupt Enable (1=enable)

 bcf                INTCON,1         ;INTF - Clear FLag Bit Just In Case

 ;*******************Set Up The Ports******************


            CLRF    	PORTA
    	    CLRF    	PORTB
	        BSF         STATUS,5    	
    	    MOVLW       b'00001001' 
            MOVWF       PORTB       
    	    BCF         STATUS,5    
    	    CALL    	SER_INIT    
Loop	    CALL    	Rcv_RS232
            MOVWF       Baf
    	    CALL        DETERMa
            CALL        DETERMb
            CALL        DETERMc
            CALL        DETERMd
            CALL        DETERMe
            CALL        DETERMf
            CALL        zegment
            CALL        xzegment
            call        numbyr
            call        mumbyrt
            BTFSC       PORTB,0X03 
            call        papereset
            goto    	Loop
 

SER_INIT
            BSF     STATUS,5        
            MOVLW   b'00010001'
            MOVWF   PORTA
            BCF     STATUS,5      
            BSF     PORTA,0X04   
            RETURN


XMIT_RS232  MOVWF   Xmit_Byte             
            MOVLW   0x08                  
            MOVWF   Bit_cntr
            BCF     PORTA, 0x01
            CALL    Bit_Delay
Ser_Loop    RRF     Xmit_Byte,f         
            BTFSS   STATUS,C
            BCF     PORTA,0x01
            BTFSC   STATUS,C
            BSF     PORTA,0x01
            CALL    Bit_Delay
            DECFSZ  Bit_cntr,f         
            GOTO    Ser_Loop
            BSF     PORTA,0x01
            CALL    Bit_Delay
            RETURN

Rcv_RS232   BTFSC   PORTA,0X04
            CALL    PANGDAMAY 
            BTFSC   PORTA, 0x00     
            GOTO    Rcv_RS232
            CALL    Start_Delay	    
            BTFSC   PORTA,0x00      
            GOTO    Rcv_RS232
            MOVLW   0x08            
            MOVWF   Bit_cntr
            CLRF    Rcv_Byte
Next_RcvBit CALL    Bit_Delay
            BTFSS   PORTA,0x00
            BCF     STATUS,C
            BTFSC   PORTA,0x00
            BSF     STATUS,C
            RRF     Rcv_Byte,f
            DECFSZ  Bit_cntr,f      
            GOTO    Next_RcvBit
            CALL    Bit_Delay
            MOVF    Rcv_Byte,W
            RETURN

Start_Delay MOVLW   0x0C
            MOVWF   Delay_Count
Start_Wait  NOP
            DECFSZ  Delay_Count,f
            GOTO    Start_Wait
            RETURN

Bit_Delay   MOVLW   0x18
            MOVWF   Delay_Count
Bit_Wait    NOP
            DECFSZ  Delay_Count,f
            GOTO    Bit_Wait
            RETURN

DETERMa     MOVF    Baf,W
            xorlw   0x61			
            btfsc   STATUS, Z
            BSF     PORTB,0x01
            RETURN

DETERMb     MOVF   Baf,W
            xorlw  0x62			
            btfsc  STATUS, Z
            BSF    PORTA,0x03
            RETURN

DETERMc     MOVF   Baf,W
            xorlw  0x63			
            btfsc  STATUS, Z
            BSF    PORTB,0x02
	        call   delay1
            bcf    PORTB,0x02            
            RETURN

DETERMd     MOVF    Baf,W
            xorlw   0x64			
            btfsc   STATUS, Z
            BSF     PORTA,0x02
            call    delay1
            bcf     PORTA,0x02              
            RETURN

DETERMe     MOVF   Baf,W
            xorlw  0x65			
            btfsc  STATUS, Z
            BCF    PORTB,0x01
            RETURN

DETERMf     MOVF   Baf,W
            xorlw  0x66			
            btfsc  STATUS, Z
            BCF    PORTA,0x03
            RETURN

papereset   MOVLW  0x76
            call   XMIT_RS232
            RETURN


PANGDAMAY   MOVLW  0x79
            call   XMIT_RS232
            RETURN

zegment     MOVF   Baf,W
            xorlw  0x78			
            btfsc  STATUS, Z
            call   sumpzeg            
            RETURN

sumpzeg     movlw   0x78
            MOVWF   seg    
            RETURN

xzegment    MOVF   Baf,W
            xorlw  0x77			
            btfsc  STATUS, Z
            call   xsumpzeg            
            RETURN

xsumpzeg    movlw   0x77
            MOVWF   seg    
            RETURN


numbyr      MOVF   seg,W
            xorlw  0x78			
            btfsc  STATUS, Z            
            call   numbo
            RETURN

mumbyrt     MOVF   seg,W
            xorlw  0x77			
            btfsc  STATUS, Z            
            call   numbt
            RETURN
         

numbo       call    res1
bark        bsf	    PORTB,6
    	    call    delay1
    	    bcf     PORTB,6
            decfsz  Baf,1        
            goto    bark
            bcf     PORTB,6 
            movlw   0x00
            MOVWF   seg
            RETURN

numbt       call    res1
burk        bsf	    PORTB,7
    	    call    delay1
    	    bcf     PORTB,7
            decfsz  Baf,1        
            goto    burk
            bcf     PORTB,7 
            movlw   0x00
            MOVWF   seg
            RETURN

res1         bsf     PORTB,5;  made it res1
            call    delay1
            bcf     PORTB,5
            bsf     PORTB,4
            call    delay1
            bcf     PORTB,4
            RETURN
  

delay1:	
;PIC Time Delay = 0.50000200 s with Osc = 4000000 Hz
		movlw	D'5'
		movwf	CounterC
		
loopp	decfsz	CounterC,1
		goto	loopp
		retlw	0	 
	end
 
Last edited:
eric you're a life saver thank you very much and for telling me also what went wrong there and how to fix it. as always i am grateful for all your help and the others in this forum. it's compiling now thanks.
 
"Also you dont need to define these registers, the include "P16F84.inc" gets the job done.
STATUS equ 0x03
PORTA equ 0x05
PORTB equ 0x06
TRISA equ 0x85
TRISB equ 0x86
INTCON equ 0x0B "


okay eric thanks ill keep that in mind
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top