#28 pdata keyword accepted but does not work

closed
None
5
2004-10-19
2003-05-21
Anonymous
No

Hi,

the pdata keyword is accepted but does not work
in two respects:

pdata volatile char u,v;

main()
{
u=1;
v=2;
}

results (with linker warnings) in:

144 ;pdata.c:5: u=1;
145 ; genAssign
0038 90 00 00 146 mov dptr,#_u
003B 74 01 147 mov a,#0x01
003D F0 148 movx @dptr,a
149 ;pdata.c:6: v=2;
150 ; genAssign
003E 90 00 00 151 mov dptr,#_v
0041 74 02 152 mov a,#0x02
0043 F0 153 movx @dptr,a

- Both variables are located at 0x0000.
- The pdata addressing mode is not used.

With correct pdata addressing it would be something like:

mov r0,#_u
mov a,#0x01
movx @r0,a
mov r0,#_v
mov a,#0x02
movx @r0,a

A quick and dirty solution would be to treat
pdata variables as if they were declared xdata?

Regards,

Frieder

Discussion

  • Maarten Brock

    Maarten Brock - 2004-10-19

    Logged In: YES
    user_id=888171

    Fixed in SDCC 2.4.6

     
  • Maarten Brock

    Maarten Brock - 2004-10-19
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks