Machine dependent code is in contrast to machine-independent, or portable, code.
Optimized code is in contrast to non-optimized code.
The two terms do not contrast each other; machine dependent code can be optimized or not optimized, and so can machine independent code.
Machine-dependent code relies on specific characteristics of the device it was written for. For example, it might depend on an integer variable to be 16 bits in size, or on a specific memory address to gain access to special hardware features (such as, for example, a ratl-time clock or serial port). Machine-dependent code is common in embedded software, which is generally written to suit small and specialized computer systems. It can be difficult to transport this code to a different machine due to these machine dependencies.
Machine independent or "portable" code contains fewer and, ideally, no such dependency. In theory, such code can be freely moved from one machine to another, provided all share support for the same programming language such as, for example, ANSI-C.
In reality however, no code is truly independent. Portable code may not depend on the size of an integer variable or the memory location of a serial port chip, but will instead depend on other factors. For example, it will depend on an ANSI compliant implementation of the C Programming language, and an operating system with a standard POSIX API.
Code optimization, by contrast, does not necessarily introduce machine dependency. Many forms of machine dependence introduced by optimization are introduced by automated optimization steps. For example, the C compiler for machine A may be able to optimize code for this particular machine for fastest excution or smallest size (or a compromise of both). Since this hardware-dependent optimization occurs at a lower level than the C programming, it is not a concern for portability.
Other optimization steps can introduce machine dependency into the source code. For example, accessing a time-critical I/O device through operating system device drivers may lead to unacceptable latencies in some application. One might then decide to accept the disadvantage of machine dependencies on this occasion in order to meet the required timing constrains.
It is generally advisable to introduce such dependencies with great care and only after careful consideration, and to the smallest amount possible.
Machine independent code is code that runs on any system, such as Windows, Linux, or OSX. This can be achieved by running the code in a Virtual Machine which converts the code to native language. Java is a language that is portable in this manner. Machine dependent code only works on specific operating system(s). An example would be C.
difference between lathe and drill machine doing full on piece of metal
a engine runs a machine
Machine-dependent (generally called "platform-dependent")
The size of an integer is compiler-dependant. The compiler itself is machine-dependant so it could be argued they are in fact machine-dependent, however we don't write code to suit the machine, we write code to suit the compiler, even when the code is machine-dependent.
machines are used to work
what is the difference between drive and machine
There is no difference between a turning machine and a lathe. They are two names for the same kind of machine
difference between lathe and drill machine doing full on piece of metal
difference between lathe and drill machine doing full on piece of metal
difference between von neumann and harvard machine
The main difference between coherent and incoherent machine is the consistency in performance. A coherent machine has processors that work in a consistent manner.Ê
a engine runs a machine
Machine-dependent (generally called "platform-dependent")
The difference is where you live.
what is the difference between 201 and 201K
machine cant generate power where as engieen can
Lowongan Kerja 2013