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
  • ok that means the program size in the MAP file is real indication of the total number of bytes that actually the application uses in the memory.

    i want to figure out how to place files in different banks so as to optimize the memory usage of PROM, i have considered that there is minimum bank switching while writing the API, but does the format in which the file are placed in different banks affects the size of the code and also its runtime (of the 64 kbytes lower 32 kbyte is common area and upper 32 kbyte can be replaced by any of one 16 banks available)

Reply
  • ok that means the program size in the MAP file is real indication of the total number of bytes that actually the application uses in the memory.

    i want to figure out how to place files in different banks so as to optimize the memory usage of PROM, i have considered that there is minimum bank switching while writing the API, but does the format in which the file are placed in different banks affects the size of the code and also its runtime (of the 64 kbytes lower 32 kbyte is common area and upper 32 kbyte can be replaced by any of one 16 banks available)

Children
No data