I know, but people were telling pretty much that stuff ends up in a computer's ROM at runtime which is blatantly false.Quote:
Originally Posted by filker0
And I've never in over 10 years in software heard anyone calling program code ROM...
Printable View
I know, but people were telling pretty much that stuff ends up in a computer's ROM at runtime which is blatantly false.Quote:
Originally Posted by filker0
And I've never in over 10 years in software heard anyone calling program code ROM...
And I didn't call program code ROM, I said that that's what ends up in ROM, in an embedded application. I write a lot of embedded code, which is stored in eeprom or flash ROM (in the old days, it was actual masked ROM) when the product ships. The code is executed directly out of that ROM; it is not copied to RAM. The non-read-only data is set up in RAM, as is the stack and the heap.Quote:
Originally Posted by jwenting
you didn't, but someone else did.
Quote:
In programming:
ROM==The executable code
RAM==The space for vars, objects, etc
Saving ROM is probably much harder than saving RAM. Treat your code like you would an old TSR from the DOS days. You only want what absolutely has to be there for the code to run. As has been said library functions and other thirdy party functions often have far too much overhead to use in your code.
To save RAM you can use shared memory techniques but they are not trivial to implement, however, I invite you to google them to find out more.
I have no experience with EEPROM's but I do have experience writing pure assembly bootstraps and kernel code. Stuffing the kernel into memory in real mode is quite an interesting task as well as using RAM for the kernel when you still have to provide enough RAM to the user in order to actually have the computer do more than just boot up.
Since I don't know the layout of the chip or how it processes instructions, opcode size, opcode byte ordering, etc., there is not much advice I can give you beyond this and beyond what has already been given.
For once I would have to say that I totally agree with filker0.
It's funny, I didn't hear to call executable code ROM too (although it is). But I saw in Dave_Sinkula and others that are calling executable code "ROM". So I sent a post to prevent confusion.
Read the C-compilers manual for the microprocessor you are using. They usually give usefull advice on the topic you are asking about.
And also, some microprocessors have only a single register and can thus not deal with pointers without a lot of instructions, thus eating EPROM (program) memory. But you were talking about the RAM. Use the proper type, if you need a single flag, a bit/bool, use such a type they may be directly supported by the processors instruction set and save up to 8 times the RAM usage compared to using a byte (char). For example the 16F8xx PIC processor have very little RAM, but supports single-bit instructions. What micro processor are you using?
Get rid of any recursive functions you might have.
wow....thanks guys/gals for your time and your infos....btw i am using cypress CY8C27443 microprocessor. i think i'll start off with the bit thing. I keep all update. thanks