PDA

View Full Version : Error code [112]/[113]



Dj tempo
- 16th June 2007, 14:35
hi im new to both this site and PIC micro controllers.

i like to learn the program and solve things myself, but im at the point of nearly pulling my hair out. i require some help.

i have compiled a new program to interface a PIC16F84A with a 4x20 LCD display.

i have 2 error codes left showing in the programe using notepad:

Error[113] : Symbol not previously defined (MOVLW)

Error[112] : Missing operator

how do i fix these errors?

some of error code as follows:

MPASM 5.01 LCD CODE 4 BIT (2).TXT 6-15-2007 19:06:30 PAGE 1


LOC OBJECT CODE LINE SOURCE TEXT
VALUE

00001 ;ANHEAD84.ASM Header for the alpha neumeric display using 6 I/O
00002
Warning[207]: Found label after column 1. (TMR0)
00000001 00003 TMR0 EQU 1 ;TMR0 is FILE 1
Warning[207]: Found label after column 1. (PORTA)
00000005 00004 PORTA EQU 5 ;PORTA is FILE 5
Warning[207]: Found label after column 1. (PORTB)
00000006 00005 PORTB EQU 6 ;PORTB is FILE 6
Warning[207]: Found label after column 1. (STATUS)
00000003 00006 STATUS EQU 3 ;STATUS is FILE 3
Warning[207]: Found label after column 1. (ZEROBIT)
00000002 00007 ZEROBIT EQU 2 ;ZEROBIT is Bit 2
00008
00009 LIST P=16F84 ;We are using the 16F84
0000 00010 ORG 0 ;0 is the start of the address
0000 2972 00011 GOTO START ;goto start
00012
00013 ;SUBROUTINE SECTION.
00014
00015 ;3 SECOND DELAY
0001 0181 00016 DELAY3 CLRF TMR0 ;Start TMR0
0002 0801 00017 LOOPA MOVF TMR0,W ;Read TMR0 into W
0003 3C60 00018 SUBLW .96 ;TIME - W
0004 1D03 00019 BTFSS STATUS,ZEROBIT ;Check TIME-W=0
0005 2802 00020 GOTO LOOPA
0006 3400 00021 RETLW 0 ;Return after TMR0 = 96
00022
00023 ;P1 SECOND DELAY
0007 0181 00024 DELAYP1 CLRF TMR0 ;Start TMR0
0008 0801 00025 LOOPC MOVF TMR0,W ;Read TMR0 into W
0009 3C03 00026 SUBLW 3 ;TIME - W
000A 1D03 00027 BTFSS STATUS,ZEROBIT ;Check TIME-W=0
000B 2808 00028 GOTO LOOPC
000C 3400 00029 RETLW 0 ;return after TMR0 = 3
00030
000D 1505 00031 CLOCK BSF PORTA,2
000E 0000 00032 NOP
000F 1105 00033 BCF PORTA,2
0010 0000 00034 NOP
0011 3400 00035 RETLW 0
00036
0012 3002 00037 A MOVLW 2 ;enables the display
0013 0085 00038 MOVWF PORTA
0014 3004 00039 MOVLW 4H
0015 0086 00040 MOVWF PORTB
0016 200D 00041 CALL CLOCK
0017 3001 00042 MOVLW 1H ;41 is code for
0018 0086 00043 MOVWF PORTB
0019 200D 00044 CALL CLOCK ;clock character onto display
001A 3400 00045 RETLW 0
00046
Warning[204]: Found pseudo-op in column 1. (B)
Error[113] : Symbol not previously defined (MOVLW)
MPASM 5.01 LCD CODE 4 BIT (2).TXT 6-15-2007 19:06:30 PAGE 2


LOC OBJECT CODE LINE SOURCE TEXT
VALUE

Error[112] : Missing operator
001B 2800 00047 B MOVLW 2 ;enables the display
001C 0085 00048 MOVWF PORTA
001D 3004 00049 MOVLW 4H
001E 0086 00050 MOVWF PORTB
001F 200D 00051 CALL CLOCK
0020 3002 00052 MOVLW 2H ;42 is code for
0021 0086 00053 MOVWF PORTB
0022 200D 00054 CALL CLOCK ;clock character onto display
0023 3400 00055 RETLW 0
00056
0024 3002 00057 C MOVLW 2 ;enables the display
0025 0085 00058 MOVWF PORTA
0026 3004 00059 MOVLW 4H
0027 0086 00060 MOVWF PORTB
0028 200D 00061 CALL CLOCK
0029 3003 00062 MOVLW 3H ;43 is code for
002A 0086 00063 MOVWF PORTB
002B 200D 00064 CALL CLOCK ;clock character onto display
002C 3400 00065 RETLW 0

any help much apreciated.

skimask
- 16th June 2007, 18:21
First, upgrade to the latest Microchip IDE. You're using MPASM 5.01. I think they're up to MPASM 5.11 (don't remember for sure). Not sure if that'll make a difference or not.
Second, post your source.
Third, what are you using for a compiler?

Darrel Taylor
- 16th June 2007, 23:01
First, upgrading MPASM won't help. (won't hurt)
Second, he posted the code, it's in the listing.
Third, he's not using a compiler, just an assembler.

Dj,

Couple problems here. <pre>Warning[207]: Found label after column 1. (TMR0)<br> 00000001 00003 TMR0 EQU 1 ;TMR0 is FILE 1</pre>The LABEL of an EQUate should be in column 1.
TMR0 EQU 1 ; This will work
TMR0 EQU 1 ; This will NOT

The letter B is a "Reserved Word". It is a Pseudo-op for BRANCH.
So just use longer (more descriptive) Labels to avoid using reserved words.

That'll take care of [113] and [112] which is caused by the 113 error.

I haven't looked at the logic of the program, just the errors.

HTH,

Dj tempo
- 17th June 2007, 16:15
thanx guys, sorted now.