Hi,
On Feb 25, 2014 10:21 PM, "Oliver Meier" <h2obrain@gmail.com> wrote:
>
> When I assign a value from an array of structs to another variable and
> do some math on the same line, I get ot wrong values.
>
> ### wrong value ###
> ;    .line    87; src/modules/app_ep1_out.c    uart_tx_buffer_LEN =
> ep_bdt[2].Cnt-1;
>      MOVFF    (_ep_bdt + 9), (_ep_bdt + 9)
>      DECF    (_ep_bdt + 9), W, B
>      BANKSEL    _uart_tx_buffer_LEN
>      MOVWF    _uart_tx_buffer_LEN, B
>
> uart_tx_buffer_LEN => 216

We are missing a banksel before the decf instruction (i. e., we should expect to have banksel _ep_bdt+9 instead of the movff instruction). That is obviously a bug. Please consider filing this work the bug tracker so it does not get lost.

> I'm really bad at assembler, but maye you see the error here?

For one "really bad in assembly" you managed to pin point the problem rather well - impressive ;-).

> Or is it probably a stack overflow or something?

No, not this time.

Kind regards,
Raphael