On 06/07/2014 12:11 PM, Roy Smith wrote:
> Several language constructs in C are there specifically to diddle bits
> in hardware. Bit fields were in the earliest implementations of the
> language to allow you to address individual bit control and status bits
> in memory-mapped device controllers. The volatile keyword is there to
> deal with bits which change value on their own (as hardware status
> registers do).
> And, why do you need a library routine to touch a memory location, when
> you can just dereference an integer? :-)
Which of course, technically, Pascal has too.
But memory addressing is only half the story. You still need interrupts
and ioctl access, both of which happen via assembly instructions that
libc exposes via a standard C subroutine interface.
Really any language can access hardware this way. Whether it's
MicroPython on an embedded system, or BASIC on a pic. The lines are