Hi,

You've found a bug that I think I fixed already some time ago. Please try
again with the latest snapshot.

Maarten

> Hello,
>
> I'm using an 8051-derivative with the 2.9.0 version of SDCC.  I am
> trying to pass parameters in xdata like this:
>
>         void WriteLEDByte( BYTE iOutput, BYTE xdata iData );
>
>         void function( void )
>         {
>             WriteLEDByte( iOutput, LED_ADDRESS );
>             ...
>
> The mapping is showing the input variable assigned to XSEG:
>
>         XSEG                               0000   007A =    122. bytes
> (REL,CON,XDATA)
>
>               Value  Global
>            --------  --------------------------------
>             ...
>           0D:0036    _WriteLEDByte_PARM_2
>             ...
>
> But when the function is called, its being loaded into a data address:
>
>                                             1712 ;
> F340_USB0_Keyboard.c:782: WriteLEDByte( iOutput, LED_ADDRESS );
>         046C 75*09 72           1713     mov    _WriteLEDByte_PARM_2,#0x72
>         046F 8A 82              1714     mov    dpl,r2
>         0471 C0 02              1715     push    ar2
>         0473 12s04rC9           1716     lcall    _WriteLEDByte
>
> And the function is trying to read it from XDATA:
>
>        04C9                    1808 _WriteLEDByte:
>        ...
>        04DC 90s00r09           1821     mov    dptr,#_WriteLEDByte_PARM_2
>        04DF E0                 1822     movx    a,@dptr
>        04E0 FB                 1823     mov    r3,a
>        ...
>
> Does anyone know what is happening here?
>
> Thanks,
> Will.
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>
>


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs 
proactively, and fine-tune applications for parallel performance. 
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to