SourceForge has been redesigned. Learn more.
Close

#18 Array addressing still not 100%

closed-fixed
nobody
5
2000-09-30
2000-07-18
Anonymous
No

Hi

I have an array of 128 21 byte records. About a year ago I raised an issue where because of an extra \0 inserted by SDCC, making the records 22 byte, the array addressing didn't work because it thought the records were still 21 byte. I have recently come back to the project and this appears to have been fixed in more recent versions, however symptoms tend to suggest that array addressing is only calculated using single-byte maths. Thus after the 12th (12*21=252, but 13*21>255) record, the wrong address is generated.

To summarise:
I should be able to go:
LCD_Write(MIDI_Instrument[Num2]);

However, instead, to make it work I have to go:
LCD_Write(MIDI_I_Ptr+((unsigned int)Num2)*21);

(where MIDI_I_Ptr is the base address of MIDI_Instrument)

Please let me know if possibly I'm doing something else wrong, but I'm pretty sure this is a bug.

Thanks
Anton (Y2@xtra.co.nz)

Discussion

  • Sandeep Dutta

    Sandeep Dutta - 2000-09-30

    Fixed in the latest source tree

     
  • Sandeep Dutta

    Sandeep Dutta - 2000-09-30
    • status: open --> closed-fixed
     

Log in to post a comment.