User forums > Using Code::Blocks

Code size for a 8051 processor

(1/1)

orbanp:
Hello Everyone,

New here, and new with Code Blocks, so please bear with me.

Eventually I would like to program in C the AT89S52 processor, that is a derivative of the 8051 processor.
Having looked at and starting a 8051 project in C::B, one of the questions at setting up the project was the maximum size of the code.
I imagine that meant the available code space in the target processor.
I left it at 64kb thinking that I would change it later.
Unfortunately I do not see or find any ways of changing that property of the project!
Is there really no way of changing that?
Do I need to delete the project and recreate it?
No big loss at this time, I am just playing with and learning the system.
The "Help" facility was not much of a help there...

Ultimately, I would like to import a project from the "MCU 8051 IDE" environment from Moravia Microsystems that I used before.
Unfortunately that system is not supported actively any longer.
Any comment on porting that project?
I guess I could just import the source and header files...
That system also used the SDCC compiler.

Thanks, Peter

BlueHazzard:

--- Quote ---Is there really no way of changing that?
--- End quote ---
i am not familiar with this project type, but it is probably only a compiler or linker option....
Have a look at
Project->Build options->Select the project name on the left->Linker settings->Other linker options



--- Quote ---I guess I could just import the source and header files...
--- End quote ---
probably the way to go... Setting the linker and compiler settings by hand...

Miguel Gimenez:
As BlueHazzard said it is a linker option. In the template you have, depending on selected compiler:

sdcc

--- Code: ---project.AddLinkerOption(_T("--code-size " + format("%u", SizeCODE)));
--- End code ---

keilc51

--- Code: ---project.AddLinkerOption(_T("CODE(0x0-"  + format("0x%04X", SizeCODE - 1)  + ")"));
--- End code ---

keilcx51

--- Code: --- project.AddLinkerOption(_T("CLASSES (XDATA (X:0x0-X:" + format("0x%04X", SizeXDATA - 1) +
                                   "), HDATA (X:0x0-X:"  + format("0x%04X", SizeXDATA - 1) +
                                   "), CODE (C:0x0-C:"   + format("0x%04X", SizeCODE - 1) +
                                   "), CONST (C:0x0-C:"  + format("0x%04X", SizeCODE - 1) +
                                   "), ECODE (C:0x0-C:"  + format("0x%04X", SizeCODE - 1) +
                                   "), HCONST (C:0x0-C:" + format("0x%04X", SizeCODE - 1) + "))"));

--- End code ---

iar8051

--- Code: ---project.AddLinkerOption(_T("-D_CODE0_END="  + format("0x%04x", SizeCODE - 1)));

--- End code ---

orbanp:
Thanks for the reply, I really appreciate it!

I did find the code size in the linker options, and could change it, as suggested.

Thanks again, Peter

Navigation

[0] Message Index

Go to full version