Compiler/Parser error ?

23 views
Skip to first unread message

David VB

unread,
Jan 11, 2025, 11:06:27 AMJan 11
to jallib
Hi there,

While trying to compile a first skeleton of a new program (some definitions, initialisations and declarations) with an (for now) empty forever loop, I bump into this strange error:

It seems like a first pass is ok and that no syntax errors remain, put then I receive this:

Compilation started at :11-01-25 16:59:42
jal jalv25r9 (compiled Jan  4 2025)
generating p-code
1236 tokens, 294280 chars; 6401 lines; 12 files
generating PIC code pass 1
Assertion failed!
[Error] (jalv2_64.exe.jal) [Line 0]
File: pic_op.c, Line 3143
Expression: !value_is_const(val1)

Compiler CommandLine:  Y:\== TOOLS\Jallib1.9\compiler\jalv2_64.exe -Wno-all -s "Y:\== TOOLS\Jallib1.9\lib;Y:\== TOOLS\PICjal\JAL\Libraries;Y:\== TOOLS\JalLibWorkspace\lib" "Y:\== PROJETS EN COURS\NAS\Ventilos\Ventilos2\Ventilos2.jal"  

Errors :0       Warnings :0
Code   :0/100    Data:0/100  Hardware Stack : 0/100  Software Stack :0


What does this mean ?

Thanks for your help !


Rob CJ

unread,
Jan 11, 2025, 11:16:24 AMJan 11
to jal...@googlegroups.com
Hi David,

I see you are using the lateste version of the compiler. There is a bug in it that I am trying to fix.

For you it is best to use compiler version jalv25r7 (not r8 since it contains another bug).

Sorry for the inconvenience but could you send me your program or at least a relevant part that creates this error?

Thanks.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens David VB <pinhe...@gmail.com>
Verzonden: zaterdag 11 januari 2025 17:06
Aan: jallib <jal...@googlegroups.com>
Onderwerp: [jallib] Compiler/Parser error ?
 
--
You received this message because you are subscribed to the Google Groups "jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallib+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jallib/174fb715-0d82-4e35-91b7-cb5668510777n%40googlegroups.com.

Rob CJ

unread,
Jan 11, 2025, 11:32:57 AMJan 11
to jal...@googlegroups.com
Hi David,

I did  a quick check and I saw the issue is occurring in a part that I did not change so I am very interested if you get the same issue with jalv25r7. You can find that version in the directotory compiler/other_versions/jalv25r7.

If so can you send me your program?

Thanks.

Kind regards,

Rob


Van: Rob CJ <rob...@hotmail.com>
Verzonden: zaterdag 11 januari 2025 17:16
Aan: jal...@googlegroups.com <jal...@googlegroups.com>
Onderwerp: Re: [jallib] Compiler/Parser error ?
 

David VB

unread,
Jan 11, 2025, 11:48:16 AMJan 11
to jallib
Thanks Rob,

I tried with r7, and result is the same

I could not send a "relevant" part of the program, since I already tried by commenting out part after part and I cannot find which part is causing troube.

Fyi, I reinstalled a clean fresh version of the 1.9 jallib latest version
Also note that a .asm file is created with a header in it and nothing else.
Seems like all the syntax checking is ok, but something goes wrong after that.....

The main file is attached to this message.   The library files that are referenced are the original 1.9 versions

Compilation started at :11-01-25 17:38:24
jal jalv25r7 (compiled Jan 29 2023)

generating p-code
1236 tokens, 294280 chars; 6401 lines; 12 files
generating PIC code pass 1
Assertion failed!
[Error] (jalv2_64.exe.jal) [Line 0]
File: pic_op.c, Line 3110
Expression: !value_is_const(val1)

Compiler CommandLine:  Y:\== TOOLS\JalLib1.9\compiler\other_versions\jalv25r7\jalv2_64.exe -Wno-all -s "Y:\== TOOLS\Jallib1.9\lib;Y:\== TOOLS\PICjal\JAL\Libraries;Y:\== TOOLS\JalLibWorkspace\lib" "Y:\== PROJETS EN COURS\NAS\Ventilos\Ventilos2\Ventilos2.jal"  


Errors :0       Warnings :0
Code   :0/100    Data:0/100  Hardware Stack : 0/100  Software Stack :0
Ventilos2.jal

David VB

unread,
Jan 11, 2025, 12:37:02 PMJan 11
to jallib
Apparently my answer did not get through....

In the meantime, I think I found something:
I had a CASE OF statement like this:

CASE str_display [i_digit] OF

I replaced it with:
dig = str_display [i_digit]
CASE dig OF

And that solved it.   Don't know why.....
Definitions are:
var byte i_digit
var byte str_display[4]


Here is the full (working) procedure in which the CASE...OF is embeddd:  (this is due to weird pinout to display, necessary to simplify PCB design)

procedure INT_interrupt is pragma interrupt
var byte dig
; Every time it's called, this routine :
; - Turns off current digit
; - Loads character to display in next digit and output it on the ports
; - Turns on next digit
    INTCON_INTF = false

; Turn everything off
    Seg_g = 0
    Seg_d = 0
    PORTC = 0b00000000

; Prepare next digit
    IF i_digit == 0
       then i_digit = 3
       else i_digit = i_digit -1
    end if

    dig = str_display [i_digit]
    IF ((i_digit == 1) | (i_digit == 2)) then     ; If it is a digit from 0 to 9
       CASE dig OF
         0 : BLOCK
               Seg_d = 1
               PORTC = 0b10101110
             END BLOCK
         1 : PORTC = 0b00001100
         2 : BLOCK
               Seg_g = 1
               Seg_d = 1
               PORTC = 0b10000110
             END BLOCK
         3 : BLOCK
               Seg_g = 1
               Seg_d = 1
               PORTC = 0b00001110
             END BLOCK
         4 : BLOCK
               Seg_g = 1
               PORTC = 0b00101100
             END BLOCK
         5 : BLOCK
               Seg_g = 1
               Seg_d = 1
               PORTC = 0b00101010
             END BLOCK
         6 : BLOCK
               Seg_g = 1
               Seg_d = 1
               PORTC = 0b10101010
             END BLOCK
         7 : PORTC = 0b00001110
         8 : BLOCK
               Seg_g = 1
               Seg_d = 1
               PORTC = 0b10101110
             END BLOCK
         9 : BLOCK
               Seg_g = 1
               Seg_d = 1
               PORTC = 0b00101110
             END BLOCK
         END CASE
      END IF

    IF (i_digit == 0) | (i_digit == 3) then
         ; if Bargraph with values from 40 (one bar - Seg a) to 100 (7 bars - Seg a to g)
          BLOCK
             if dig > 39 then
               BLOCK
                 Seg_a = 1
                 if dig > 49 then
                 BLOCK
                  Seg_b = 1
                  if dig > 59 then
                  BLOCK
                   Seg_c = 1
                   if dig > 69 then
                   BLOCK
                    Seg_d = 1
                    if dig > 79 then
                    BLOCK
                     Seg_e = 1
                     if dig > 89 then
                     BLOCK
                      Seg_f = 1
                      if dig > 99 then
                       Seg_g = 1
                      end if
                     END BLOCK end if
                    END BLOCK end if
                   END BLOCK end if
                  END BLOCK end if
                 END BLOCK end if
                END BLOCK end if
             END BLOCK
          END IF

; Turn ON new digit
    case i_digit of
      3 : Left_Bar  = TRUE     ; digit 3
      2 : Left_Dig  = TRUE     ; digit 2
      1 : Right_Dig = TRUE     ; digit 1
      0 : Right_Bar = TRUE     ; digit 0
    end case

end procedure

vsurducan

unread,
Jan 12, 2025, 1:03:38 AMJan 12
to jal...@googlegroups.com
Hi David,
The type of error you report I have seen it over various versions of jal compiler for different situations. Define first, use it after was indeed the cure I found for.

However, it looks your interrupt routine does not read any interrupt register to trigger it...Who calls your interrupt routine?  

As is, it seems to be just a normal routine, perhaps you may delete the "pragma interrupt" and call it from main program with the same functionality.
Best.

--
You received this message because you are subscribed to the Google Groups "jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallib+un...@googlegroups.com.

Rob CJ

unread,
Jan 12, 2025, 1:39:46 AMJan 12
to jal...@googlegroups.com
Hi David, Vasile,

Thanks for the info.

It is an existing bug apparently. I will have a look at it later, since I still need to fix another issue in jalv25r9 (which is also present in jalv25r8).

After some analysis I will register it as a bug on GitHub zo it is at least registered. Not sure if I can solve it but I can have a look.

Good that you found a workaround.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens vsurducan <vsur...@gmail.com>
Verzonden: zondag 12 januari 2025 07:03
Aan: jal...@googlegroups.com <jal...@googlegroups.com>
Onderwerp: Re: [jallib] Re: Compiler/Parser error ?
 

rob...@hotmail.com

unread,
Jan 18, 2025, 4:08:02 AMJan 18
to jallib
Hi David,

I registered your issue as a compiler bug. I used your program and made it a bit smaller to demonstrate the problem. I had a quick look at the compiler code but have no idea yet what is going on since I do not yet understand why the assertion there. I can remove it of course but there must be a reason for it.

Maybe I am able to solve it later.

Kind regards,

Rob


Op zaterdag 11 januari 2025 om 16:06:27 UTC schreef pinhe...@gmail.com:

David VB

unread,
Jan 18, 2025, 6:50:55 AMJan 18
to jallib
Thanks !
Not urgent since there is a simple workaround

Have a nice week-end
Reply all
Reply to author
Forward
0 new messages