开发者

How are I/O library routines implemented for languages which does not support low-level access?

开发者 https://www.devze.com 2023-02-07 04:11 出处:网络
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

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号