Menu

Chip def file / case on labels in assembly

2006-12-14
2013-05-30
  • OldComputerGuy

    OldComputerGuy - 2006-12-14

    I get the error:  Chip definition files could not be found!
    I think this may be because I did not install MPLab in the default directory, but rather in c:\MPLAB. If this is the cause, how do I change it?

    Also, when I compiled the GCBasic produced assembler file, many of the call statements refer to a label is in uplow case, but the label itself is in upper case (or vise versa) which produces an MPASM error. This happens on many of the GCbasic system produced labels (i.e. SysMultSub).  Here is an example:

    Error[113]  : Symbol not previously defined (SysMultSub)
    001F   2000           00095         call    SysMultSub

    and the generated label;

    0082                  00239 SYSMULTSUB             
    Error[113]  : Symbol not previously defined (SYSCALCTEMPX)
    0082   0180           00240         clrf    SYSCALCTEMPX
    0083                  00241 MUL8LOOP               
    Error[113]  : Symbol not previously defined (SYSCALCTEMPA)
    0083   0800           00242         movf    SYSCALCTEMPA, W
    Error[113]  : Symbol not previously defined (SYSCALCTEMPB)
    0084   1800           00243         btfsc   SYSCALCTEMPB, 0
    Error[113]  : Symbol not previously defined (SYSCALCTEMPX)
    0085   0780           00244         addwf   SYSCALCTEMPX, F
    0086   1003           00245         bcf     STATUS, C
    Error[113]  : Symbol not previously defined (SYSCALCTEMPB)
    0087   0C80           00246         rrf     SYSCALCTEMPB, F
    0088   1003           00247         bcf     STATUS, C
    Error[113]  : Symbol not previously defined (SYSCALCTEMPA)
    0089   0D80           00248         rlf     SYSCALCTEMPA, F
    Error[113]  : Symbol not previously defined (SYSCALCTEMPB)
    008A   0880           00249         movf    SYSCALCTEMPB, F
    008B   1D03           00250         btfss   STATUS, Z
    008C   2883           00251         goto    MUL8LOOP
    008D   0008           00252         return 

    Obviously labels are case sensitive.

     
    • Hugh Considine

      Hugh Considine - 2006-12-15

      GCBASIC is programmed to look for the header files in 3 locations - the MPLAB default location, the gputils default location, or a subdirectory of the GCBASIC folder called "MPASM". Basically GCBASIC will work fine if you go to C:\Program Files\GCBASIC, create a folder called "MPASM", and then copy the necessary .inc files into it.

      There is an option in MPLAB/MPASM to turn off case sensitivity. If you turn off case sensitivity, then everything should work properly. The GCBASIC installer will usually to turn off case sensitivity.

      Incidentally, what installer of GCBASIC did you use?

       
      • OldComputerGuy

        OldComputerGuy - 2006-12-15

        OK, all of those problems are fixed. Thanks!

        One more thing.  I have the GCBasic code:

        snd:
        ' put sound routine here
          for i = 1 to 20
            tone(325,100)
            wait 20 10ms
          next i

        Which produces the assembler code:

        0030                  00111 SND            
        0030   01A5           00112         CLRF    I
        0031                  00113 SYSFORLOOP1            
        0031   0AA5           00114         INCF    I,F
        Warning[202]: Argument out of range.  Least significant bits used.
        0032   3045           00115         MOVLW   325
        0033   00A4           00116         MOVWF   FREQUENCY
        0034   3064           00117         MOVLW   100
        0035   00A3           00118         MOVWF   DURATION
        0036   208D           00119         CALL    TONE
        0037   3014           00120         MOVLW   20
        0038   00B1           00121         MOVWF   SYSWAITTEMP10MS
        0039   2047           00122         CALL    DELAY_10MS
        003A   3014           00123         MOVLW   20
        003B   0225           00124         SUBWF   I,W
        003C   1C03           00125         BTFSS   STATUS, C
        003D   2831           00126         GOTO    SYSFORLOOP1

        I wanted to produce a tone of 3250 HZ. If I understand the documentation correctly, I should put the freq / 10.  Is this correct?  Obviously, 325 is 145 hex, so the assembler only used the lower bye (45).  I probably did something wrong here.

         
        • Hugh Considine

          Hugh Considine - 2006-12-16

          In versions of GCBASIC before 0.9.2.0, there was a limit of 2550 Hz in the Tone command. The Tone command was changed as follows in 0.9.2.0:
          - The frequency is now input in Hz, not in Hz x 10
          - The maximum frequency is now 20000 Hz (although higher frequencies do not work very well)

          It's probably a good idea to download a newer version of GCBASIC than 0.9.0.4 - there are quite a few bugs that have been fixed since, several new features, and an improved help file.

           
    • OldComputerGuy

      OldComputerGuy - 2006-12-15

      Thanks for your help Hugh!
      I used the Minimal_0904 installer.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.