1

Languages which don't support low level access to the machine, such as memory-mapped I/Os, often (if not always) have library routines which provides such access. Now, if the language itself does not support such access, how are these library routines implemented?

gablin
  • 4,678
  • 6
  • 33
  • 47

1 Answers1

1

It really depends on the language. Some languages have an "interop" facility which allows a method written in that language to call a library primitive that can be implemented in another language (C, assembler, etc.).

For example, .NET languages have the P/Invoke facility that allows them to call unmanaged DLLs (that can be written in C, C++, assembler, or any other language that allows exported functions from DLLs), but for internal CLR use there's also the "internal call" modifier which is a direct call into a library primitive implemented inside one of the CLR DLLs.

Sasha Goldshtein
  • 3,499
  • 22
  • 35
  • Ah, interesting. Never even considered that option. I thought that perhaps the compiler itself provided the code for such routines and included that code as part of the machine code. – gablin Jan 29 '11 at 08:42