Compiler refuses to compile


Closed Thread
Results 1 to 10 of 10
  1. #1

    Angry Compiler refuses to compile

    Hi,

    My PICBASIC PRO compiler stubbornly refuses to compile any programs, even those that would compile before and 1 line test programs. When compiling a program dev6.pbp the error window showed these errors.


    Eror DEV6.ASM 3:[235] opcode expected instead of "
    Eror DEV6.ASM 5:[235] opcode expected instead of "
    Eror DEV6.ASM 9:[238] preprocessor directive expected
    Eror DEV6.ASM 9:[235] opcode eexpected instead of ' (('
    Eror DEV6.ASM 10:[235] opcode expected instead of "
    Eror DEV6.ASM 9:[238] preprocessor directive expected
    Eror DEV6.ASM 9:[235] opcode eexpected instead of ' (('
    Eror DEV6.ASM 10:[235] opcode expected instead of "
    Etc.

    This is the start of the DEV6.ASM file as seen in Windows notepad. (the first line is empty).


    ; PICBASIC PRO(TM) Compiler 2.47, (c) 1998, 2006 microEngineering Labs, Inc. All Rights Reserved.
    PM_USED EQU 1

    INCLUDE "16F877A.INC"


    ; Define statements.
    #define CODE_SIZE 8
    #define OSC 4

    RAM_START EQU 00020h
    RAM_END EQU 001EFh
    RAM_BANKS EQU 00004h
    BANK0_START EQU 00020h
    BANK0_END EQU 0007Fh
    BANK1_START EQU 000A0h
    BANK1_END EQU 000EFh
    BANK2_START EQU 00110h
    BANK2_END EQU 0016Fh
    BANK3_START EQU 00190h
    BANK3_END EQU 001EFh
    EEPROM_START EQU 02100h
    EEPROM_END EQU 021FFh

    R0 EQU RAM_START + 000h
    R1 EQU RAM_START + 002h
    R2 EQU RAM_START + 004h
    R3 EQU RAM_START + 006h
    R4 EQU RAM_START + 008h
    R5 EQU RAM_START + 00Ah

    etc....

    I have reloaded the software, reset the compiler options in my MicroCode Studio Plus but to no avail.

    Can anybody suggest a possible remedy?

    Many thanks,
    Mark

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    What is the actual dev6.pbp code that you are trying to compile/assemble?

  3. #3


    Did you find this post helpful? Yes | No

    Red face Pic Basic Code

    I assume it's Pic Basic - the Pic Basic Pro manual describes it as 'English-Like BASIC'

    The target is a 16F877A mounted in an ME Labs LabX2 Experimenter board

    Thanks
    Mark

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by CodeShredder View Post
    Hi,

    My PICBASIC PRO compiler stubbornly refuses to compile any programs, even those that would compile before and 1 line test programs. When compiling a program dev6.pbp the error window showed these errors.


    Eror DEV6.ASM 3:[235] opcode expected instead of "
    Eror DEV6.ASM 5:[235] opcode expected instead of "
    Eror DEV6.ASM 9:[238] preprocessor directive expected
    Eror DEV6.ASM 9:[235] opcode eexpected instead of ' (('
    Eror DEV6.ASM 10:[235] opcode expected instead of "
    Eror DEV6.ASM 9:[238] preprocessor directive expected
    Eror DEV6.ASM 9:[235] opcode eexpected instead of ' (('
    Eror DEV6.ASM 10:[235] opcode expected instead of "
    Etc.

    This is the start of the DEV6.ASM file as seen in Windows notepad. (the first line is empty).


    ; PICBASIC PRO(TM) Compiler 2.47, (c) 1998, 2006 microEngineering Labs, Inc. All Rights Reserved.
    PM_USED EQU 1

    INCLUDE "16F877A.INC"


    ; Define statements.
    #define CODE_SIZE 8
    #define OSC 4

    RAM_START EQU 00020h
    RAM_END EQU 001EFh
    RAM_BANKS EQU 00004h
    BANK0_START EQU 00020h
    BANK0_END EQU 0007Fh
    BANK1_START EQU 000A0h
    BANK1_END EQU 000EFh
    BANK2_START EQU 00110h
    BANK2_END EQU 0016Fh
    BANK3_START EQU 00190h
    BANK3_END EQU 001EFh
    EEPROM_START EQU 02100h
    EEPROM_END EQU 021FFh

    R0 EQU RAM_START + 000h
    R1 EQU RAM_START + 002h
    R2 EQU RAM_START + 004h
    R3 EQU RAM_START + 006h
    R4 EQU RAM_START + 008h
    R5 EQU RAM_START + 00Ah

    etc....

    I have reloaded the software, reset the compiler options in my MicroCode Studio Plus but to no avail.

    Can anybody suggest a possible remedy?

    Many thanks,
    Mark
    Hi Mark, Looks as if you opened the .asm file of your program and not the .PBP or .BAS
    File of the same name, close it and open the same file that has a .BAS or .PBP suffix and that should do the trick.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by CodeShredder View Post
    I assume it's Pic Basic - the Pic Basic Pro manual describes it as 'English-Like BASIC'

    The target is a 16F877A mounted in an ME Labs LabX2 Experimenter board

    Thanks
    Mark
    Well, I know that...........
    PIC BASIC PRO

    What's your code...or is that first post your actual, FULL code?

  6. #6


    Did you find this post helpful? Yes | No

    Red face Compiler problems

    Hi Joe S,

    Yes, something is processing the assembler file but the file I have open in the editor window is the .pbp file, and I can't see anything in the options that might be telling the compiler to use the .asm file.

    Hi Skimask,

    The code above is not the Dev6.pbp code, but even in a one line program declaring a variable I get pretty much the same error messages. :{

    Here is the beginning of the Dev6 code

    TRISB = %11111111 ' Set PORTB to input
    TRISC = %11111111 ' Set PORTC to input
    TRISD = %11111111 ' Set PORTD to input
    CMCON = 7 ' Set PORTA to digital
    ADCON1 = 7 'Disable analog A\D
    TRISA.0 = 0 'Set PORTA.0 to output
    DEFINE OSC 4

    init: Pause 500 ' Wait for LCD to start up
    serout2 PORTA.0,84,[254]
    serout2 PORTA.0,84,[88]
    serout2 PORTA.0,84,["Hello"]
    PORTC.7 = 0
    PORTC.5 = 0

    sFocus VAR Byte 'Holds value to which focus will be set later
    panel VAR Byte 'panel number
    pLast VAR Byte 'last panel selected
    cFocus VAR Byte 'current focus
    stSq VAR Byte 'start square
    chars var byte[7] 'string chracters
    'charsW var word[7] 'string chracters
    stSize VAR Byte 'number of accumulated string chars
    arStart VAR Byte
    asciiCd VAR word
    myPort VaR word
    myString VAR WORD
    listPos VAR BYTE

    I think I shall have to strip it all off the computer and reload again.

    Thanks
    Mark
    Last edited by CodeShredder; - 18th June 2008 at 11:07.

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Does this mean you are not using MPASM?
    PM_USED EQU 1

    If so, maybe you should set up MCS to use MPASM.???
    Dave
    Always wear safety glasses while programming.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    In the posts above, you have "INCLUDE 16F877A.INC"
    Do you actually have that in the program? MCS/PBP already take care of that for you.

    I think I shall have to strip it all off the computer and reload again.
    Doesn't sound like a bad idea...clean it all out... While your at it, spend the $25 and upgrade to PBP 2.50A.

    Here's the way I do a fresh reload. In my mind, I start from the PIC itself, and work my way backward, to the PBP source code itself...

    1) Load the programmer software/hardware/firmware. Test it out, make sure it recognizes and handles the programmer the way it needs to handle it.

    2) Load the latest version of MPLAB with any patches that need to be in there. Ensure that MPLAB can compile, and puts any result HEX files where you can find them.

    3) Load PBP and any patches that need to be applied. Try it out, compile a file, assemble it (whether you do it, or you set up PBP to let MPLAB do it, either way)

    4) Load MCS, connect it to PBP, connect it to MPASM.

    5) Try it all out.

    And don't load all of this into your "My Documents" folder. There seem to be the occassional 'long path' issues. It seems to work best for me if I put PBP in the root dir of C:, and MPLAB and MCS in their normal 'program files' folder.

  9. #9


    Did you find this post helpful? Yes | No

    Talking Compiler problem solved

    Hi Guys,

    Thanks for all your advice, I have reloaded all the software elements and can now compile and load programs onto the PIC, but not sure why the compiler did not work in the first place.

    After reloading the software I still got the same error messages about the assembler file, so looked again at the compile and program options. Under assembler it said 'not defined', the find buttons were greyed out and the check box saying Use MPASM was unchecked, so I checked that and compiled a program without any problems. During compiliation some progress dialog boxes came up which I have never seen before so I am assuming that in previous instalations a different compiler was installed. Does that sound likely?

    After four evenings of frustration the joy that a little flashing LED can bring is surprising!

    Thanks to all who assist with these newsgroups, as a web programmer and not an electronics engineer I can only see half the picture and the information gleaned from these posts and the archives is invaluable.

    Cheers,
    Mark

  10. #10
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Do not know how far along you are in electronics and maybe you have been here
    http://www.parallax.com/tabid/535/Default.aspx
    There is a lot of good info and if you work through the experiments and adapt them to PBP I bet you will gain.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. compiler help!!!!
    By MINHLE in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 20th April 2008, 18:52
  2. USB PBPL Compile errors
    By Rob in forum USB
    Replies: 11
    Last Post: - 7th April 2008, 08:18
  3. Cannot compile for 40MHz 4 x pll
    By passion1 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 21st October 2007, 17:50
  4. Replies: 2
    Last Post: - 9th February 2006, 22:03
  5. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts