Re: Larkin, Power BASIC cannot be THAT good:
- From: Martin Brown <|||newspam|||@nezumi.demon.co.uk>
- Date: Fri, 12 Jun 2009 08:10:58 +0100
Nobody wrote:
On Thu, 11 Jun 2009 11:30:18 -0700, Joel Koltner wrote:
Although I did once meet a C compiler that pretty much ignored the "const" part of "const int" and therefore actually allocated memory (in RAM!) and stored the value, fetching it again every time it was needed.
It's required to store it somewhere so that you can take its address.
"const" variables are still lvalues, not expressions.
A lot of the older compilers did that copy to ram even when they purported to generate code for embedded systems. The solution was to do the constant tables in assembler and then export a reference to them.
The physical address of a const in ROM is known at link time. And you can be sure that no attempt by the CPU to trash a ROM value will ever succeed. The same cannot be said of a value in ram if things go haywire.
This immutability of ROM did cause amusement in bank switched user register CPUs like the 9900 and 99k. You could tell it was in big trouble if the user register bank was in ROM where incrementing the program counter doesn't work any more.
I never appreciated at the time just how good the 99k was at interrupt handling until I tried to do the same job on a 68k series.
Regards,
Martin Brown
.
- References:
- Re: Larkin, Power BASIC cannot be THAT good:
- From: AZ Nomad
- Re: Larkin, Power BASIC cannot be THAT good:
- From: John Larkin
- Re: Larkin, Power BASIC cannot be THAT good:
- From: John Larkin
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Martin Brown
- Re: Larkin, Power BASIC cannot be THAT good:
- From: John Larkin
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Martin Brown
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Phil Hobbs
- Re: Larkin, Power BASIC cannot be THAT good:
- From: krw
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Phil Hobbs
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Joel Koltner
- Re: Larkin, Power BASIC cannot be THAT good:
- From: AZ Nomad
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Joel Koltner
- Re: Larkin, Power BASIC cannot be THAT good:
- From: AZ Nomad
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Michael
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Rich Grise
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Michael
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Joel Koltner
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Nobody
- Re: Larkin, Power BASIC cannot be THAT good:
- Prev by Date: Re: OT: SeaMonkey..
- Next by Date: Re: OT: SeaMonkey..
- Previous by thread: Re: Larkin, Power BASIC cannot be THAT good:
- Next by thread: Re: Larkin, Power BASIC cannot be THAT good:
- Index(es):
Relevant Pages
|