Answer the question
In order to leave comments, you need to log in
What does const volatile mean?
There is a port address 0x30.
What does this expression mean? And why cast the address to such a pointer?
const volatile char *port = (const volatile char *) 0x30;
Answer the question
In order to leave comments, you need to log in
const - to exclude attempts to write to it.
volatile - every time you access, go to the address and take data, and not cache.
If some cell in memory (in this case at address 0x30) is changed by another thread or, for example, by hardware, it is volatile.
It would be better to write
const volatile char* const port = (const volatile char *) 0x30;
constexpr const volatile char *port = (const volatile char *) 0x30;
var
SomePort : byte absolute $30;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question