Loading ...
Sorry, an error occurred while loading the content.

Re: [jallist] Re: varriable allocation problem

Expand Messages
  • Gordon Williams
    From: Matt To: Sent: Tuesday, June 01, 2010 12:01 AM Subject: [jallist] Re: varriable allocation problem
    Message 1 of 4 , Jun 1, 2010
    • 0 Attachment
      From: "Matt" <matthewschinkel@...>
      To: <jallist@yahoogroups.com>
      Sent: Tuesday, June 01, 2010 12:01 AM
      Subject: [jallist] Re: varriable allocation problem


      > but I think you want to do this to allocate bytes in a word like this:
      >
      > var byte*4 _fat_totalSectors ;total sectors on media
      > var byte _fat_totalSectors_temp[4] at _fat_totalSectors
      > var byte _fat_totalSectors3 at _fat_totalSectors_temp[3]
      > var byte _fat_totalSectors2 at _fat_totalSectors_temp[2] ;only 3 low bytes
      non-zero
      > var byte _fat_totalSectors1 at _fat_totalSectors_temp[1]
      > var byte _fat_totalSectors0 at _fat_totalSectors_temp[0] ;(Low)
      >
      >
      > Are you working on FAT32? I have a fat32 library.
      >

      That's the way that I have done it in the past. I thought that I would try
      another way because it is a bit easier to write.

      Maybe Kyle could make this easier and less error prone by adding a feature
      to the compiler. It would be nice!

      I'm updating some code that I wrote 4 years ago for FAT12/16 with enough
      functionality to use on 16F chips with limited memory.

      Regards,

      Gordon Williams
    • zz
      Greetings, ... I doubt you ll be happy with the output, but one method that works: var bit*8 _fat_totalSectors3 at _fat_totalSectors:24 var bit*8
      Message 2 of 4 , Jun 2, 2010
      • 0 Attachment
        Greetings,

        --- In jallist@yahoogroups.com, "Gordon Williams" <gwilliams@...> wrote:
        >
        > I have this in my program:
        >
        > var byte*4 _fat_totalSectors ;total sectors on media
        > var byte _fat_totalSectors3 at _fat_totalSectors:24
        > var byte _fat_totalSectors2 at _fat_totalSectors:16 ;only 3 low bytes
        > non-zero
        > var byte _fat_totalSectors1 at _fat_totalSectors:8
        > var byte _fat_totalSectors0 at _fat_totalSectors:0 ;(Low)
        >

        I doubt you'll be happy with the output, but one method that works:

        var bit*8 _fat_totalSectors3 at _fat_totalSectors:24
        var bit*8 _fat_totalSectors2 at _fat_totalSectors:16
        var bit*8 _fat_totalSectors1 at _fat_totalSectors:8
        var bit*8 _fat_totalSectors0 at _fat_totalSectors

        the compiler should probably be able to handle this a bit more gracefully, and at a minimum should warn or error since it is clearly not being handled. I'll add it to the bug list. I want to get jalv24n out since it's stable and I don't want to do anything to jeopardize that.

        --kyle
      Your message has been successfully submitted and would be delivered to recipients shortly.