Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the difference between the const and _rom C-language keywords?

c-language const difference
0
Posted

What is the difference between the const and _rom C-language keywords?

0

In the 8051 architecture, besides ROM there are several other memory spaces and most of them require special instructions to access. To designate in which memory space an object is to be defined, a ‘storage specifier’ keyword can be used in your C source code. The 8051 C-compiler recognizes the following storage specifiers: _data, _bdat, _idat, _pdat, _xdat, _rom. The 8051 C-compiler treats the _rom storage type in a special way: Since the ROM memory space is physically read-only, it always implies the type qualifier const. The ANSI-C standard states that the type qualifier const can be used to specify read-only objects. During compilation, it allows the compiler to issue an error message for a source line where an attempt is made to write to the object.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123