[Info-vax] LLVM, volatile and async VMS I/O and system calls
chris
chris-nospam at tridac.net
Sun Sep 26 13:33:02 EDT 2021
On 09/25/21 00:06, Dave Froble wrote:
> On 9/24/2021 6:16 PM, chris wrote:
>> On 09/22/21 20:58, Bob Gezelter wrote:
>>> On Wednesday, September 22, 2021 at 2:11:40 PM UTC-4, Simon Clubley
>>> wrote:
>> orld.
>>>>
>>>> There's a reason why volatile is used so liberally in embedded
>>>> bare-metal
>>>> programming. :-)
>>>>
>>>> Simon.
>>
>> Primarily because embedded spends a lot of time accessing hardware
>> registers directly, for example:
>>
>> volatile unsigned char *ttyport = (volatile unsigned char*) TTY_PORT
>>
>> which assigns a numerc value to the pointer and tells the compiler
>> not to optimise it away, nor change the value.
>>
>> Something application level code should rarely, if ever, see...
>
> Well, now, that sort of depends on your definition of "application level
> code", doesn't it?
>
> I sometimes design/write stuff where I consider such issues.
>
> Of course I write it in Basic, not that shitty C stuff. Basic seems to
> usually get things right. (Don't tell John I wrote that, he'll hold it
> against me when I ask him to fix Basic.)
>
> :-)
>
>
I never took to Basic, but it does have keywords like peek and poke to
to shoot through all the os layers and protections right down to the
hardware :-). If I had to program Basic, I think I would try to avoid
that. Fine on an Apple II at the time though...
C is just the same of course, but it was designed as a systems
programming language from the start...
Chris
More information about the Info-vax
mailing list