This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Regarding bank switching

I am using mentor graphics 8051 based 8051EW device. I am using code banking (16 banks). After running my code i am using LX51 comman to link the lnk fie and than "OHX51" to convert the obj file to hex and than "hexbin2" to convert hex to bin. In my code i have 5 files each conatning one function and a main. c file. When i palce the main.c and all the other 5 files in common bank, the following is the size of file ifound
obj format file -> 20 KB size after converting
hex file--> 2 kb size and after coverting hex to bin
bin file--> 1 kb size.

But if i place main.c in common bank and each of the five files in five seperate banks i.e bank1, bank2 so on than following is the file size odserved

obj format file -->29kb
hex file --> 6kb
bin file --> 193 kb can anone please tell me why is there such tremendous increase in the fianl executable file from 1 kb to 193 kb even though the bank switching code tht is inserted by complier is of afew bytes. Immediate help is highly appreciated

Parents
  • "After running my code i am using LX51 comman to link"

    You can't run you code before it's linked!

    I presume you mean, "After compiling my code..."?

    "can anone please tell me why is there such tremendous increase in the fianl executable file"

    It's not actually an "executable file"; it is just a byte-by-byte image of your PROM - including the blank spaces that are unused in each Bank!

    The Hex file will also have additional overheads to deal with loading the code into the different address ranges.

    Note that the "obj" format includes debug information.

Reply
  • "After running my code i am using LX51 comman to link"

    You can't run you code before it's linked!

    I presume you mean, "After compiling my code..."?

    "can anone please tell me why is there such tremendous increase in the fianl executable file"

    It's not actually an "executable file"; it is just a byte-by-byte image of your PROM - including the blank spaces that are unused in each Bank!

    The Hex file will also have additional overheads to deal with loading the code into the different address ranges.

    Note that the "obj" format includes debug information.

Children