MPLAB Error with Assembly

Thread Starter

ELECTRONERD

Joined May 26, 2009
1,147
Hey Everyone,

I've just started learning assembly and have, of course, encountered some problems. I believe the code isn't really a problem, but rather the adequate directories in my build options? Although I'm not sure what settings are necessary in order to vindicate a successful build.

Rich (BB code):
;**************************************************
;        Author: Austin Schaller
;         Program: Blinking_LED_ASM.ASM
;        Date January 8th, 2011
;**************************************************

LIST    p=16F648A        ; Define Processor
#include <p16F648a.inc>
     CONFIG   _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF & _INTOSC_OSC_NOCLKOUT
     
     RADIX DEC        ; Define RADIX as a decimal unless otherwise noted
     
     ERRORLEVEL            -302        ; Supress bank switching messages
     
     ;Define RAM Location
     CBLOCK             0x20
                         Delay1
                         Delay2
                         Delay3
     ENDC
     
     ORG                 0
          
     START
         BANKSEL         TRISA
         MOVLW            0xFF        ; Arrange PORTA bit 0 as output
         MOVWF            TRISA
             
         MOVLW             0xFF        ; Arrange PORTB as output
         MOVWF             TRISB
         
         MOVLW             0x07        ; Disable comparator
         MOVWF             CMCON
         
         BLINK
             BANKSEL        PCON        ; Switch to bank 1
             BSF            PCON, 3        ; Set internal oscillator to 4MHz
             BANKSEL        PORTA
             BSF            PORTA, 1        ; Turn on output to LED
             CALL         Delay_1s        ; Wait
             BCF            PORTA, 1        ; Turn off output to LED
             CALL         Delay_1s        ; Wait
             GOTO BLINK
             
             
     ; Subroutines
     Delay_1s
         MOVLW             255        ; This is 1 second
         MOVWF             Delay1
         MOVWF             Delay2
         
         MOVLW            0x05
         MOVWF            Delay3
         
         Wait
             DECFSZ        Delay, F
             GOTO         Wait
             DECFSZ        Delay2, F
             GOTO         Wait
             DECFSZ        Delay3, F    
             RETURN
             
     END
The PIC I'm using is irrelevant at this point, as I am just trying to get a successful build in sequence. Does anybody know what's wrong?

I would appreciate your assistance!

Thanks,

Austin
 

Markd77

Joined Sep 7, 2009
2,806
What errors do you get?
I think you need to set the device in the "configure, select device" menu as well as in the code. Otherwise it works for me without any problems.
 

Thread Starter

ELECTRONERD

Joined May 26, 2009
1,147
Here are the errors, and I did change the "Configure---> Select Device" option to the particular PIC I'm using.

Rich (BB code):
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.mcp' started.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Sat Jan 08 18:24:34 2011
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\MCC18\mpasm\mpasmwin.exe" /q /p16F648A "C:\Documents and Settings\Parent\My Documents\MPLAB Assembly Projects\Blinking_LED_ASM.asm" /l"Blinking_LED_ASM.lst" /e"Blinking_LED_ASM.err" /o"Blinking_LED_ASM.o" /d__DEBUG=1
Warning[205] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 7 : Found directive in column 1. (LIST)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 17 : Found label after column 1. (Delay1)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 18 : Found label after column 1. (Delay2)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 20 : Found label after column 1. (START)
Message[302] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 23 : Register in operand not in bank 0.  Ensure that bank bits are correct.
Message[302] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 26 : Register in operand not in bank 0.  Ensure that bank bits are correct.
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 31 : Found label after column 1. (BLINK)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 41 : Found label after column 1. (Delay_1s)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 46 : Found label after column 1. (Wait)
Error[113]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 47 : Symbol not previously defined (Delay)
Error[129]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 52 : Expected (END)
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.mcp' failed.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Sat Jan 08 18:24:36 2011
----------------------------------------------------------------------
BUILD FAILED
EDIT: I now recall that I had this same "'__DEBUG" error when I was utilizing C as my language. The problem was fixed by setting the build options appropriately, but since this is ASM, I'm not sure what settings are correct? Perhaps there are other settings as well?
 
Last edited:

Markd77

Joined Sep 7, 2009
2,806
The first error is in the Wait subroutine. "Delay" should be "Delay1"

The second error is a bit odd because it is "Expected END" and you have the end statement. I'll have an investigate tomorrow but it's beer o'clock now.

The "Debug is defined" thing isn't an error, it's supposed to say that.
 
I've had a few brews, so take what I saw with a grain of salt.

As to the errors:

"Delay" isn't defined. In your CBLOCK directive you defined "Delay1", "Delay2", and "Delay3" but there is no "Delay defined there.
Basically, the assembler doesn't know where to put it because you didn't define it.

I'm not positive on the "expected END" error, but I will tell you that I put my subroutines BEFORE my main program. I'd also but a "GOTO START" after the "ORG 0"

Here's how I'd redo the code..... see if it works for you.
Make sure you put two underscores before the CONFIG. This compiles fine.

Rich (BB code):
;**************************************************
;        Author: Austin Schaller
;        MODIFIED BY:  The ever pompous wannaBinventor
;         Program: Blinking_LED_ASM.ASM
;        Date January 8th, 2011
;**************************************************

LIST    p=16F648A        ; Define Processor
#include <p16F648a.inc>
__CONFIG   _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF & _INTOSC_OSC_NOCLKOUT
     
     RADIX DEC        ; Define RADIX as a decimal unless otherwise noted
     
     ERRORLEVEL            -302        ; Supress bank switching messages
     
     ;Define RAM Location
     CBLOCK             0x20
                         Delay1
                         Delay2
                         Delay3
     ENDC
     
     ORG    0
     GOTO    START    
     
     ; Subroutines
     Delay_1s
         MOVLW             255        ; This is 1 second
         MOVWF             Delay1
         MOVWF             Delay2
         
         MOVLW            0x05
         MOVWF            Delay3
         
         Wait
             DECFSZ        Delay1, F
             GOTO         Wait
             DECFSZ        Delay2, F
             GOTO         Wait
             DECFSZ        Delay3, F    
             RETURN
             
     
                 
          
     START
         BANKSEL         TRISA
         MOVLW            0xFF        ; Arrange PORTA bit 0 as output
         MOVWF            TRISA
             
         MOVLW             0xFF        ; Arrange PORTB as output
         MOVWF             TRISB
         
         MOVLW             0x07        ; Disable comparator
         MOVWF             CMCON
         
         BLINK
             BANKSEL        PCON        ; Switch to bank 1
             BSF            PCON, 3        ; Set internal oscillator to 4MHz
             BANKSEL        PORTA
             BSF            PORTA, 1        ; Turn on output to LED
             CALL         Delay_1s        ; Wait
             BCF            PORTA, 1        ; Turn off output to LED
             CALL         Delay_1s        ; Wait
             GOTO BLINK
           
     END
 

Markd77

Joined Sep 7, 2009
2,806
I got it to compile as well after changing Delay, adding the double underscore to config, but I also had to delete "&_DATA_CP_OFF" from the CONFIG to get it to complie.
 

Thread Starter

ELECTRONERD

Joined May 26, 2009
1,147
Mark, I implemented the same changes you advised and get the following errors with this code:

Code:

Rich (BB code):
;**************************************************
;        Author: Austin Schaller
;         Program: Blinking_LED_ASM.ASM
;        Date January 8th, 2011
;**************************************************

LIST    p=16F648A        ; Define Processor
#include <p16F648a.inc>
     __CONFIG   _CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF & _INTOSC_OSC_NOCLKOUT
     
     RADIX DEC        ; Define RADIX as a decimal unless otherwise noted
     
     ERRORLEVEL            -302        ; Supress bank switching messages
     
     ;Define RAM Location
     CBLOCK                 0x20
                             Delay1
                             Delay2
                             Delay3
     ENDC
     
     ORG                     0
     GOTO                     START
          
     START
         BANKSEL             TRISA
         MOVLW                0xFF        ; Arrange PORTA bit 0 as output
         MOVWF                TRISA
             
         MOVLW                 0xFF        ; Arrange PORTB as output
         MOVWF                 TRISB
         
         MOVLW                 0x07        ; Disable comparator
         MOVWF                 CMCON
         
         BLINK
             BANKSEL            PCON        ; Switch to bank 1
             BSF                PCON, 3        ; Set internal oscillator to 4MHz
             BANKSEL            PORTA
             BSF                PORTA, 1        ; Turn on output to LED
             CALL             Delay_1s        ; Wait
             BCF                PORTA, 1        ; Turn off output to LED
             CALL             Delay_1s        ; Wait
             GOTO             BLINK
             
             
     ; Subroutines
     Delay_1s
         MOVLW                 255        ; This is 1 second
         MOVWF                 Delay1
         MOVWF                 Delay2
         
         MOVLW                0x05
         MOVWF                Delay3
         
         Wait
             DECFSZ            Delay1, F
             GOTO             Wait
             DECFSZ            Delay2, F
             GOTO             Wait
             DECFSZ            Delay3, F    
             RETURN
             
     END
Errors:
Rich (BB code):
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.mcp' started.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Sun Jan 09 09:43:31 2011
----------------------------------------------------------------------
Make: The target "C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.o" is out of date.
Executing: "C:\MCC18\mpasm\mpasmwin.exe" /q /p18F1320 "C:\Documents and Settings\Parent\My Documents\MPLAB Assembly Projects\Blinking_LED_ASM.asm" /l"Blinking_LED_ASM.lst" /e"Blinking_LED_ASM.err" /o"Blinking_LED_ASM.o" /d__DEBUG=1
Warning[205] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 7 : Found directive in column 1. (LIST)
Warning[215] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 7 : Processor superseded by command line.  Verify processor symbol.
Message[301] C:\MCC18\MPASM\P16F648A.INC 34 : MESSAGE: (Processor-header file mismatch.  Verify selected processor.)
Warning[230] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 9 : __CONFIG has been deprecated for PIC18 devices.  Use directive CONFIG.
Error[126]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 9 : Argument out of range (not a valid config register address)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 17 : Found label after column 1. (Delay1)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 18 : Found label after column 1. (Delay2)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 20 : Found label after column 1. (START)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 31 : Found label after column 1. (BLINK)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 41 : Found label after column 1. (Delay_1s)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 46 : Found label after column 1. (Wait)
Error[113]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 47 : Symbol not previously defined (Delay)
Error[129]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 52 : Expected (END)
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.mcp' failed.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Sun Jan 09 09:43:32 2011
----------------------------------------------------------------------
BUILD FAILED
wannaBinventor, I also tried your code and got these errors:

Errors:
Rich (BB code):
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.mcp' started.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Sun Jan 09 09:44:18 2011
----------------------------------------------------------------------
Make: The target "C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.o" is out of date.
Executing: "C:\MCC18\mpasm\mpasmwin.exe" /q /p18F1320 "C:\Documents and Settings\Parent\My Documents\MPLAB Assembly Projects\Blinking_LED_ASM.asm" /l"Blinking_LED_ASM.lst" /e"Blinking_LED_ASM.err" /o"Blinking_LED_ASM.o" /d__DEBUG=1
Warning[205] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 7 : Found directive in column 1. (LIST)
Warning[215] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 7 : Processor superseded by command line.  Verify processor symbol.
Message[301] C:\MCC18\MPASM\P16F648A.INC 34 : MESSAGE: (Processor-header file mismatch.  Verify selected processor.)
Warning[230] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 9 : __CONFIG has been deprecated for PIC18 devices.  Use directive CONFIG.
Error[126]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 9 : Argument out of range (not a valid config register address)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 17 : Found label after column 1. (Delay1)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 18 : Found label after column 1. (Delay2)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 20 : Found label after column 1. (START)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 31 : Found label after column 1. (BLINK)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 41 : Found label after column 1. (Delay_1s)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 46 : Found label after column 1. (Wait)
Error[113]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 47 : Symbol not previously defined (Delay)
Error[129]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 52 : Expected (END)
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.mcp' failed.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Sun Jan 09 09:44:19 2011
----------------------------------------------------------------------
BUILD FAILED
I don't think this is a bug problem anymore, but rather my settings. What are both your settings in build options?
 

Markd77

Joined Sep 7, 2009
2,806
I don't have any settings, I'm using Quickbuild mode.
You seem to still be getting odd errors, suggesting that the wrong PIC device is selected and also some of the problems like "Delay" that have been fixed are still in the error report. Maybe project files are corrupted, although I've never seen it before.
Maybe copy the code and create a new project in a new directory, or try without creating a project to see what happens.
 

Thread Starter

ELECTRONERD

Joined May 26, 2009
1,147
I tried restoring the default settings and when I build, I get the picture in the attachment. What should I do? You can find your settings for this in: Project ---> Build Options ---> Project --->MPASM/C17/C18 Suite.

Also, where is the "Quickbuild" mode? How can I confer my settings with yours?

 

Attachments

Markd77

Joined Sep 7, 2009
2,806
Absolute every time.

Quickbuild mode, you just go to file menu, click new, then save with the ".asm" extension. You can then use quickbuild in the project menu. It's OK for testing code but your screen layout and other things don't get saved.
 

Thread Starter

ELECTRONERD

Joined May 26, 2009
1,147
I tried a new project file, and it creates more problems. Now my build stops right in the middle and won't continue; it keeps saying "Executing...".
 

Markd77

Joined Sep 7, 2009
2,806
I haven't changed any settings since installing about a week ago. (It's on Ubuntu running with WINE, but that shouldn't make any difference).
I think you've covered all the possibilities I can think of now, does seem a strange problem.
I think I heard once that there are problems with long paths, ie. putting the files in C:\pic would under some circumstances work, while a long path would cause problems. Not sure if that is the case any more.
Might be an idea to try the Microchip forums too, there are a lot of experts on there.
 
Mark, I implemented the same changes you advised and get the following errors with this code:

Code:

Rich (BB code):
;**************************************************
;        Author: Austin Schaller
;         Program: Blinking_LED_ASM.ASM
;        Date January 8th, 2011
;**************************************************
 
LIST    p=16F648A        ; Define Processor
#include <p16F648a.inc>
     __CONFIG   _CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF & _INTOSC_OSC_NOCLKOUT
 
     RADIX DEC        ; Define RADIX as a decimal unless otherwise noted
 
     ERRORLEVEL            -302        ; Supress bank switching messages
 
     ;Define RAM Location
     CBLOCK                 0x20
                             Delay1
                             Delay2
                             Delay3
     ENDC
 
     ORG                     0
     GOTO                     START
 
     START
         BANKSEL             TRISA
         MOVLW                0xFF        ; Arrange PORTA bit 0 as output
         MOVWF                TRISA
 
         MOVLW                 0xFF        ; Arrange PORTB as output
         MOVWF                 TRISB
 
         MOVLW                 0x07        ; Disable comparator
         MOVWF                 CMCON
 
         BLINK
             BANKSEL            PCON        ; Switch to bank 1
             BSF                PCON, 3        ; Set internal oscillator to 4MHz
             BANKSEL            PORTA
             BSF                PORTA, 1        ; Turn on output to LED
             CALL             Delay_1s        ; Wait
             BCF                PORTA, 1        ; Turn off output to LED
             CALL             Delay_1s        ; Wait
             GOTO             BLINK
 
 
     ; Subroutines
     Delay_1s
         MOVLW                 255        ; This is 1 second
         MOVWF                 Delay1
         MOVWF                 Delay2
 
         MOVLW                0x05
         MOVWF                Delay3
 
         Wait
             DECFSZ            Delay1, F
             GOTO             Wait
             DECFSZ            Delay2, F
             GOTO             Wait
             DECFSZ            Delay3, F    
             RETURN
 
     END
wannaBinventor, I also tried your code and got these errors:

Errors:
Rich (BB code):
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.mcp' started.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Sun Jan 09 09:44:18 2011
----------------------------------------------------------------------
Make: The target "C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.o" is out of date.
Executing: "C:\MCC18\mpasm\mpasmwin.exe" /q /p18F1320 "C:\Documents and Settings\Parent\My Documents\MPLAB Assembly Projects\Blinking_LED_ASM.asm" /l"Blinking_LED_ASM.lst" /e"Blinking_LED_ASM.err" /o"Blinking_LED_ASM.o" /d__DEBUG=1
Warning[205] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 7 : Found directive in column 1. (LIST)
Warning[215] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 7 : Processor superseded by command line.  Verify processor symbol.
Message[301] C:\MCC18\MPASM\P16F648A.INC 34 : MESSAGE: (Processor-header file mismatch.  Verify selected processor.)
Warning[230] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 9 : __CONFIG has been deprecated for PIC18 devices.  Use directive CONFIG.
Error[126]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 9 : Argument out of range (not a valid config register address)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 17 : Found label after column 1. (Delay1)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 18 : Found label after column 1. (Delay2)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 20 : Found label after column 1. (START)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 31 : Found label after column 1. (BLINK)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 41 : Found label after column 1. (Delay_1s)
Warning[207] C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 46 : Found label after column 1. (Wait)
Error[113]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 47 : Symbol not previously defined (Delay)
Error[129]   C:\DOCUMENTS AND SETTINGS\PARENT\MY DOCUMENTS\MPLAB ASSEMBLY PROJECTS\BLINKING_LED_ASM.ASM 52 : Expected (END)
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Parent\My Documents\MPLAB C Projects\Blinking_LED_ASM.mcp' failed.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Sun Jan 09 09:44:19 2011
----------------------------------------------------------------------
BUILD FAILED
I don't think this is a bug problem anymore, but rather my settings. What are both your settings in build options?
Something is wrong here. There's no way you should be able to get an "Error: ...not previously defined 'delay' " because my code changed that.

Where is that error 126 taking you when you double click on it. Also, off the top of my head try and delete the "p" before the "p16F648a.inc" directive. The assembly can also act funny if you don't have everything justified correctly.

Look at an example program and then match the spacing and what not on those.
 
Last edited:

Thread Starter

ELECTRONERD

Joined May 26, 2009
1,147
This is my exact problem now, since the build just freezes. Can someone attach the MPASMWIN.exe file they have (and please, one who has successfully built programs), since that appears to be corrupt on the latest version? I'm going to replace it with the current version I have.
 

Markd77

Joined Sep 7, 2009
2,806
XP, the best ever operating system from MS. Any luck with either of the files? I forgot to mention that you have to rename one of them but you probably knew that. I'm using a windows emulator so the file should be exactly the same as on a windows system.
 

t06afre

Joined May 11, 2009
5,934
Top