I'm trying to write simple Intel HEX parser by myself.
And after reading http://en.wikipedia.org/wiki/Intel_HEX wiki I still have some questions.
1.Can be addresses overlapped? I mean is this check is always correct?
if (hexl[k]->address + hexl[k]->count > hexl[k+1]->address)
{
// These addresses are sorted
HEX_DEBUG("Addresses [%" PRIx16 "] and [%"PRIx16"]"
" are overlapping", hexl[k]->address,
hexl[k+1]->address);
return HEX_EOVERLAP;
}
2.Can the HEX file which is used for loading to some EPROM have gaps between addresses? I mean should I use
if (hexl[k]->address + hexl[k]->count > hexl[k+1]->address) {} // > comparison
or
if (hexl[k]->address + hexl[k]->count != hexl[k+1]->address) {} // != comparison
check. I couldn't find some restrictions about that.