Is all of the 4kb internal ROM on Intel MCS-51 available for user code? Are there any system routines that might take up some of the space? I managed to optimize my code to 4091b and I'd really like to know whether I need to optimize it further.
Thanks.
I was under impression that 8051 could be manufactured with a desired program in the internal ROM. If the internal ROM was used entirely by the chip itself and useless to a programmer, there would certainly be no need for ROM-less 8031 and 8032 microcontrollers, would there? Also, there's the EA control signal which would be quite useless if internal ROM was used only to store some sort of "system code".
The reason for my dilemma is that I read on this website that software reset is performed by jumping to code at C:0000h. I'm wondering if this is where the entry point of user's program is stored or if the location is the beginning of a system routine that performs the reset.
I'm wondering if this is where the entry point of user's program is stored or if the location is the beginning of a system routine that performs the reset.
OK, shake your head 5 times, so the dust get out.
Today you can't even buy a ROM version of the '51, thus all code is "out in the open" and no hidden "system routines" exist. The code that was provided by the customer for the original '51 also started right off 0.
unless YOU include them there are no "system routines"
OK, in C the compiler include startup.a51 but that is not a "system routine", it is a "compiler initializer"
if you have books or something that babble about the original MCS-51 THROW IT OUT!
Erik
www.8052.com/.../120112
should clear your head
Thanks, Erik, that's finally what I wanted to know. I'll get back to you about whether shaking my head 5 times had any effect.
So Assuming you could get one... Yes the Intel 8051 chip is 4K and holds 4096 bytes. Addressed 0 to 4095, and is ROM The Intel 8751 had EEPROM, and was available with a window. Those Parts where erasable.
What about IAP and similar routines...?
"I was under impression that 8051 could be manufactured with a desired program in the internal ROM"
The ROM was part of the manufacturing process - so it had to be manufactured with the program in!
"If the internal ROM was used entirely by the chip itself and useless to a programmer, there would certainly be no need for ROM-less 8031 and 8032 microcontrollers, would there?"
I don't get your point there. The point of the ROM-less versions was for the cases where you could not commit to manufacturing your code, so you just had to have it in an external device - usually UV-EPROM.
"Also, there's the EA control signal which would be quite useless if internal ROM was used only to store some sort of 'system code'"
Again, I don't get your point there. EA allows you to use external Code memory instead of any internal ROM.
"The reason for my dilemma is that I read on this website that software reset is performed by jumping to code at C:0000h."
Address C:0000h is where the hardware starts execution after a hardware reset. So, jumping to that location will cause the code to start from the same point as after a hardware reset, but will not actually do a hardware reset. Hence it's probably better to call it a re-start than a "reset"...
"I'm wondering if this is where the entry point of user's program is stored"
It is where everything must start - so, in that sense, it is the "entry point"
For a 'C' program, it would go immediately to the startup code - which ends up calling the user's main()
http://www.keil.com/support/man/docs/c51/c51_ap_startup.htm
No!
It had UV-EPROM!
"was available with a window"
To let the UV light in.
"Those Parts where erasable"
Yes - but not electrically eraseable!
Sorry about, that I stuttered The Intel 8751 had EPROM.