Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

problem in hex file

Status
Not open for further replies.

mausami kumari

New Member
the compiler is generating the hex file of 1KB
my program is-
// Coding (MAIN):
C:
#include<reg51.h>

sbit in=P1^1;
sbit out=P1^2;
sbit LED=P2^0;

void delay_msec(int);

void main()
{
  int count=0;
  in=1;
out=1;  //////  declaring ‘in’ and ‘out’ as input
LED=0;
while(1)
    {
     if(in==1)
        {
         while(!out){}
         count++;
         LED=1;
        delay_msec(1000);
        }
  if(out==1 && count)
     {
      while(!in){}
      count--;
      delay_msec(1000);
     if(!count)
         LED=0;
     }
  }
}

// Coding (delay.h):

void delay_msec(int time)
{
int i=0;
while(i<time)
   {
    TMOD=0x10;
    TH1=0xfc;
    TL1=0x66;
    TR1=1;
     while(TF1==0);
         {
          TR1=0;
          TF1=0;
          i++;
       }
   }
}
the compiler is showing 0 errors and 0 warning
if the hex file is being created properly, please send it to my <email address deleted - Moderator>
Please reply soon
Its URGENT

Moderator note:
e-mail addresses in plain view on the forum are an invitation to spammers.
Use the Conversation system for initial one to one communication.
 
Last edited by a moderator:
It's weird.... The file is 647 bytes... Shows as 1kb but takes up 4kb on a drive???
perhaps it depends on OS and filing system management. I am , of course , NOT and expert.
try to see any file that is less than 1kB
i use winXP, i never found one that is less than 1kb
 
It depends on OS and the file system used. Files are stored in blocks and a block is 4kb (typically), 8kb, 16kb... I do not remember the specifics at this time, but I recall that Windows uses a default block size of 4kb. Hence, any filed that is 1 byte to 4096 bytes in general will take up the same amount of space on disk - 4kb. All OS work in this manner, so it's not a Windows thing.
 
Hi
if you using Keil complier it uses "startup.a51" to initialization for controller and SDCC will not, it always good practices to generate list file by configuring in the compiler option
 

Attachments

  • project+keil.rar
    9.6 KB · Views: 253
  • project_sdcc.rar
    5.4 KB · Views: 255
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top