The operating system abstracts access to basic equipment and makes it accessible to programmers through system calls. On Windows, this is done through the Windows API (which, as a rule, is further abstracted by libraries that make programming easier, such as MFC, etc.). On UNIX, this is often done with interrupts, which System C simplifies a bit by following the POSIX api (often with several system-dependent additions).
For example, on Linux, system calls are made through int 0x80 , with several registers loaded with function arguments, and the C library simplifies them, allowing you to call, for example. read , with the expected arguments ( int fd, void *buf, size_t count ) . This translates to an interrupt call to which the kernel responds.
These two ways of making requests to the operating system are incompatible, and therefore you (as a rule) cannot run the Windows executable on UNIX systems and vice versa, without using any additional system that acts as a translation level, for example, WINE, VMWare, etc. d. (Although the two works are very different).
(By the way, a.out says nothing about the contents of the executable file, this is the traditional file name assigned to executable files compiled on UNIX systems, and is not suitable for โassembler output.โ GCC allows cross-compilation, so you can even compile Win32 -compatible .EXE files with it. You can use the -o flag for gcc to specify the name of the output file, which indicates that it does not affect the actual format of the output file.)
Sdaz macskibbons
source share