Jump to content
  • Advertisement
Sign in to follow this  
Daos

Simple question

This topic is 5161 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Fist: What is bitwise constant? There are bitwise operators and constants...

Second: It's only operating system's good will to place something in ROM. However - if it sees some good candidate for being in ROM, there's a change it will be placed in ROM.

Oxyd

Share this post


Link to post
Share on other sites
Yeah, there's something a bit weird about wanting to put bitwise constants in ROM. Are you wanting it in ROM to write protect it? Because if you are, most languages provide constant variables that you can't write to after you set them (well, you can, but it's a complete hack).

You'll need to give a bit more detail if you want to get some help here.

-Auron

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Simple question alright. So simple nobody has a freakin clue what the hell you are talking about!
Please elaborate - A LOT!
Start from the absolute beginning. What are you writing?

Share this post


Link to post
Share on other sites
Quote:
Original post by Kelly G
Wait, you can't write to ROM, can you? Unless he's talking about a CD rom.


Well, you can, kind of... but I HIGHLY doubt that he's getting at anything like erasing the OS from the ROM on a console or something.

Then again...

-Auron

Share this post


Link to post
Share on other sites
Sorry ,i was out for a while,this is what i've found in a book
ROMability
If an object is defined as const, it is a candidate to be placed in read-only memory (ROM), which is often an important consideration in embedded systems programming. Simply making an object const, however, is not enough – the requirements for ROMability are much stricter. Of course, the object must be bitwise-const, rather than logical-const. This is easy to see if logical constness is implemented only through the mutable keyword, but probably not detectable by the compiler if constness is cast away inside a const member function. In addition,


The class or struct must have no user-defined constructors or destructor.
There can be no base classes (covered in Chapter 14) or member objects with user-defined constructors or destructors.
The effect of a write operation on any part of a const object of a ROMable type is undefined. Although a suitably formed object may be placed in ROM, no objects are ever required to be placed in ROM.



It should be more clear now!

Share this post


Link to post
Share on other sites
Guys i know this is sick but i really want an answer the excerpt i gave you seems strange indeed.[lol]

Share this post


Link to post
Share on other sites
Quote:
Original post by Daos
Sorry ,i was out for a while,this is what i've found in a book
ROMability
If an object is defined as const, it is a candidate to be placed in read-only memory (ROM), which is often an important consideration in embedded systems programming. Simply making an

...
a ROMable type is undefined. Although a suitably formed object may be placed in ROM, no objects are ever required to be placed in ROM.



It should be more clear now!


If you're working with embedded systems, sure, place the constant within the E(E)PROM memory, why waste good (often limited in embedded systems) RAM on something that is already defined? As for specifically a bit-wise constant, unless you're talking about a flag bit (in a bitmap arrangement with other flags) you could, but you'd waste the other 7 bits within that space...

>shrug<

Is this for an embedded project?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!