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.

On Sat, Jan 11, 2025, 19:37 David VB <[email protected]> wrote:

> 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
> Le samedi 11 janvier 2025 à 17:06:27 UTC+1, David VB a écrit :
>
>> 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 3143Expression:
>> !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 !
>>
>>
>> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/jallib/ba9659fa-d8c8-4ed8-b266-3b3ca200c193n%40googlegroups.com
> <https://groups.google.com/d/msgid/jallib/ba9659fa-d8c8-4ed8-b266-3b3ca200c193n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/jallib/CAM%2Bj4qs1p_Rz9cHm3SRA6n9zNpfYMTQd4jLXh2p7kKqNFjAORg%40mail.gmail.com.

Reply via email to