In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what is machine code and bytecode". In daily operation, I believe that many people have doubts about what machine code and bytecode are. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for everyone to answer the question of "what is machine code and bytecode?" Next, please follow the editor to study!
What is machine code?
Machine code (machine code), the scientific name for machine language instructions, sometimes called original code (Native Code), is data that can be directly interpreted by the CPU of a computer.
In a general sense, machine code is the code that can be executed directly by the computer and executes the fastest.
To write programs in machine language, programmers should first memorize all the instruction codes and codes of the computer used. When programming by hand, the programmer has to handle the storage allocation, input and output of each instruction and data, and remember the state of the unit of work used in each step of the programming process. This is a very tedious task, and the time it takes to write a program is often dozens or hundreds of times longer than the actual running time. Moreover, the program is full of 0 and 1 instruction code, which is not intuitive and error-prone. Nowadays, with the exception of professionals from computer manufacturers, the vast majority of programmers no longer learn machine languages.
Machine language is understood and used by microprocessors and is used to control its operating binaries. Machine language instructions from 8086 to Pentium can range from 1 byte to 13 bytes. Although machine language seems to be very complex, it is regular. There are instructions in up to 100000 machine languages. This means that all of these categories cannot be listed.
* * Summary: * * Machine codes are machine instructions that are directly read and run by the computer CPU. They run the fastest, but they are very obscure and difficult to write, and are not accessible to practitioners.
What is a bytecode?
Bytecode
Bytecode (Bytecode) is a binary file that contains an execution program and consists of a sequence of op code / data pairs. Bytecode is a kind of intermediate code, which is more abstract than machine code and needs to be translated by a literal translator before it can become the intermediate code of machine code.
Usually it has been compiled, but has nothing to do with the specific machine code. Bytecode is not usually readable like source code, but a sequence of encoded numeric constants, references, instructions, and so on.
Bytecode is mainly designed to realize specific software operation and software environment, which has nothing to do with hardware environment. Bytecode is implemented through compilers and virtual machines. The compiler compiles the source code into bytecode, and virtual machines on a specific platform translate the bytecode into instructions that can be executed directly. A typical application of bytecode is Java bytecode.
Bytecode is converted to generate machine instructions through JVM (JAVA virtual machine) at run time, so it can run better across platforms.
* * Summary: * * Bytecode is a binary code (file) in an intermediate state (intermediate code). It needs to be translated by a literal translator before it can become machine code.
At this point, the study of "what is machine code and bytecode" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.