| ??? 02/23/08 19:22 Read: times |
#151345 - Speed Responding to: ???'s previous message |
Craig said:
Obviously. But is that just to protect the non-changing element from bad code? Because if it's a constant, by definition it's not really a variable. And the easiest way to make sure it doesn't change is to put it in an area of memory that can't (usually) change: code memory. All true. But on the 8051, the only way for a program to access code memory is with either MOVC A,@A+PC or MOVC A,@A+DPTR. That's a pretty expensive ordeal when compared with all the speedy variants of MOV that manipulate internal data memory. I think that's why you might want to have a 'const' element that's not in code memory. -- Russ |



