Keil Logo Arm Logo

Discussion Forum

MCS-51 available internal ROM

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Miloš Rašic
Posted
22-May-2012 16:47 GMT
Toolset
C51
New! MCS-51 available internal ROM

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.

Read-Only
Author
Per Westermark
Posted
22-May-2012 16:52 GMT
Toolset
C51
New! RE: MCS-51 available internal ROM

Are you running a licensed version of the compiler, or the evaluation version.

For the evaluation version, you should take a closer look at this link:
http://www.keil.com/demo/limits.asp

Read-Only
Author
Miloš Rašic
Posted
22-May-2012 16:55 GMT
Toolset
C51
New! RE: MCS-51 available internal ROM

I apologize if this is a wrong place to ask this kind of question. My problem is not with the compiler. I want to know if my code, which runs without problems in the compiler in ROM (COMPACT) mode, would fit in the original Intel 8051 microcontroller internal ROM.

Read-Only
Author
erik malund
Posted
22-May-2012 17:51 GMT
Toolset
C51
New! why????

would fit in the original Intel 8051 microcontroller internal ROM.
why> it's been out of production for a decade.

anyhow, if the I/O is the same (many modern derivatives have 'advanced' I/O) the brand does not matter. Of course, if you transfer from a derivative with e.g. HW I²C to bit-banging there will be a difference.

Erik

Read-Only
Author
Andrew Neil
Posted
22-May-2012 19:40 GMT
Toolset
C51
New! RE: the original Intel 8051 microcontroller internal ROM

The original intel ROM was exactly that - Read-ONLY Memory.

It was not programmable - so it's really irrelevant whether your code would fit into it or not!

(if you want to know out of pure academic interest, then look at the summary information in your build output - also in the Map file)

Read-Only
Author
Miloš Rašic
Posted
22-May-2012 19:50 GMT
Toolset
C51
New! RE: the original Intel 8051 microcontroller internal ROM

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.

Read-Only
Author
erik malund
Posted
22-May-2012 20:21 GMT
Toolset
C51
New! OK, shake your head 5 times, so the dust get out

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

Read-Only
Author
erik malund
Posted
22-May-2012 20:45 GMT
Toolset
C51
New! methinks it's "bible time"

http://www.8052.com/faqs/120112

should clear your head

Read-Only
Author
Miloš Rašic
Posted
22-May-2012 20:53 GMT
Toolset
C51
New! RE: OK, shake your head 5 times, so the dust get out

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.

Read-Only
Author
Andrew Neil
Posted
22-May-2012 22:46 GMT
Toolset
C51
New! RE: unless YOU include them there are no "system routines"

What about IAP and similar routines...?

Read-Only
Author
Neil Kurzman
Posted
22-May-2012 21:50 GMT
Toolset
C51
New! RE: the original Intel 8051 microcontroller internal ROM

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.

Read-Only
Author
Andrew Neil
Posted
22-May-2012 23:03 GMT
Toolset
C51
New! RE: The Intel 8751 had EEPROM


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!

Read-Only
Author
Neil Kurzman
Posted
23-May-2012 00:06 GMT
Toolset
C51
New! RE: The Intel 8751 had EEPROM

Sorry about, that I stuttered The Intel 8751 had EPROM.

Read-Only
Author
Andrew Neil
Posted
22-May-2012 23:00 GMT
Toolset
C51
New! RE: the original Intel 8051 microcontroller internal ROM

"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

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.