Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/30/03 10:23
Read: times


 
#37734 - RE: 4k
Responding to: ???'s previous message
"Have you convert your *.IHX to binary? The size of *.IHX does not represents the code size becouse it's an INTEL Hex file."

Good point, here is a program I wrote to do just that.....


#include stdio.h
#include string.h

int main(int argc, char* argv[])
{
char szBuf[1024];
int iMemUsed=0;
int iMemLine=0;
	while(gets(szBuf)!=NULL)
	{
		if(szBuf[0]!=':')
		{
			printf("Not an Intel HEX format file.n");
			return 0;
		}
		if( sscanf(&szBuf[1],"%02X",&iMemLine)==1)
		{
			iMemUsed+=iMemLine;
		}
	}
	double dbl = (double)iMemUsed;
	dbl /=1024;

	printf("%d Bytes (%4.2fK) Used.n",iMemUsed,dbl);
	return 0;
}


List of 16 messages in thread
TopicAuthorDate
4k            01/01/70 00:00      
   RE: 4k            01/01/70 00:00      
   RE: 4k            01/01/70 00:00      
      RE: 4k            01/01/70 00:00      
RE: 4k            01/01/70 00:00      
   RE: 4k            01/01/70 00:00      
RE: 4k            01/01/70 00:00      
RE: 4k            01/01/70 00:00      
RE: 4k            01/01/70 00:00      
RE: 4k            01/01/70 00:00      
RE: 4k            01/01/70 00:00      
RTFM!!            01/01/70 00:00      
   RE: RTFM!!            01/01/70 00:00      
RE: RTFM!!            01/01/70 00:00      
RE: hex to bin size / float ? YES !            01/01/70 00:00      
   RE: hex to bin size / float ? YES !            01/01/70 00:00      

Back to Subject List