New information:

The function readint() in peep.c complains because it gets the string 
'[_ptr_rx]'.
This is not just with rrc, but also with and, or, ld. Also with numeric address:
        and     a,[0x6000]
        or a,[0x6000]
        ld a,[0x6000]

I have an easy work-around for "rrc [_ptr_rx]" so I am not stuck.
        ldw     x,_ptr_rx
        rrc     (x)

The assembler seems to be happy with the syntax:
     00011E C6 50 06         [ 1]  266         ld      a, 0x5006
      000121 A4 20            [ 1]  267         and     a, #(1 << 5)
      000123 AB FF            [ 1]  268         add     a, #255
      000125 CE 00 34         [ 2]  269         ldw     x, _ptr_rx
      000128 76               [ 1]  270         rrc     (x)
      000129 72 36 00 34      [ 4]  271         rrc     [_ptr_rx]

It seems that the peephole optimizer does not like this addressing mode.

Anything I can do to help?

Thanks,
-Richard

On Tuesday 23 January 2018, Richard Hodges wrote:
> Hello, everyone!
> 
> I am getting an error that I don't understand. I have an interrupt function
> with some inline assembly, and I can't see anything wrong with it. Am I
> missing something? I got this error with 3.6.0 #9615, and then again with
> 3.6.9 #10186
> 
> pi@stm8pi:~ $ sdcc -mstm8 -c x.c
> x.c:21: error 9: FATAL Compiler Internal Error in file 'peep.c' line number
> '46' : readint() got non-integer argument.
> Contact Author with source code
> x.c:21: error 9: FATAL Compiler Internal Error in file 'peep.c' line number
> '46' : readint() got non-integer argument.
> Contact Author with source code
> x.c:21: error 9: FATAL Compiler Internal Error in file 'peep.c' line number
> '46' : readint() got non-integer argument.
> Contact Author with source code
> 
> Here is the preprocessor output I used to verify:
> 
> char     bits_rx;
> char    *ptr_rx;
> 
> void tim2c_isr(void) __interrupt (14)
> {
>     *(volatile char *)(0x5304) = 0;
> 
>     if (!bits_rx)
>  return;
>     bits_rx--;
>     if (bits_rx & 0x80)
>  return;
> __asm
>     ld a, 0x5006
>     and a, #(1 << 5)
>     add a, #255
>     rrc [_ptr_rx]
> __endasm;
> if (!(bits_rx & 7))
>     ptr_rx++;
> }
> 
> It compiles fine without the inline assembly. Sorry if I am missing
> something obvious!
> 
> Thanks,
> -Richard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to