Touchstone Words


How High Level Languages Are Converted To Machine Code | Touchstone Words

Popular Articles

Sexual activity and body health
Do You Know If You Are Sexually Active
Biofuel, Biodiesel, Environment, Fuel, Fossil Fuel, Energy, biohydrogen, biomethanol, biohyrdrogen d
Pros and Cons of Biofuel Energy
Porn actors who go to Hollywood
From Porn performances to Hollywood
social and economical state of a country
Pros and cons of capitalism vs socialism
Perceptions and mind thinking
What are perceptions and how to manage them
Taylor Swift nightmare songs
Top Ten Worst Taylor Swift Songs Shared by her Fans
Blockchain Hyperledger family
Intro to Hyperledger Family and Hyperledger Blockchain Ecosystem
How to get right attitude woman
Why in dating and relationship, attitude matters
Blow job tips
Pros and Cons of Blow Jobs
Public sex
Best Places for Public Hookup

How High Level Languages are Converted to Machine Code

By Shane Staret on 2018-04-14

It’s amazing isn’t it? You can type some words and numbers on a screen and poof. You just created a software program. That is essentially how all modern high-level programming languages work, as there is a great amount of abstraction involved. But as any programmer knows, the computer is not actually reading the words that you write on screen, rather it can only interpret machine language, or binary code. Of course, this means that these high-level languages must be converted into lower-level languages, like assembly, then finally into machine code. But how do words on a screen that make sense

speekmind_college_contentspeekmind_college_content

As you can see from the image above, the compiler is the program that takes every individual line of code and converts it into object code, which is essentially assembly language for our purposes.  What actually happens is that the compiler runs through the high-level language statements multiple times until it completely builds the object code. The reason why the compiler cannot just take one look at each line of the high-level code and convert it is due to the complexity of some high-level language programs. For example, a variable may change values throughout the run of a program or a line in the code below might affect a line in the code above, meaning the compiler will have to take a look at the code above again. So, the object code that is finally built by the compiler goes through many iterations. But how does a compiler actually “choose” how a line of code gets converted? How does it know to convert “int x = 3;” to “ldx r22, 3”?

Well, essentially the compiler breaks up the code you typed into many small tokens. Then, it looks for any keywords that always leads to the same exact object code. For example, if a token contains “int”, then the compiler may have a map that directly associates the word “int” with the command “ldx [register value], [integer value]”. After doing this multiple times, it may then convert all of these tokens into a parse tree for efficiency. After the parse tree is created, it is possible to visualize all of the possible object code commands that could be created from the initial higher-level code. However, the compiler is not finished. There may still be inefficiencies within the code. Using the parse tree, the compiler can get rid of any unused variables, or unnecessary loops that don’t affect the lower-level code, leading to a smaller parse tree and a more efficient program. After this is done, the object code has been created and optimized, which allows the linker to come in and combine all of the object code files, then convert that combined executable into machine language.

Combining object code files into a single executable is not a simple process. The linker basically is the exception catcher. It looks through all of the libraries that all the object code files referenced to make sure the syntax is correct. If a particular symbol in the object code does not match up with any libraries, it throws an exception, potentially halting the program from continuing. If all of the object code files manage to have no exceptions, then the linker will look at the memory addresses of the symbols in the libraries that are referenced. It will then begin storing the object code in particular addresses based on where their symbols are located within the memory. If identical constants are referenced in one object file or multiple, instead of placing multiple identical constants in multiple memory locations, it will just put it into one this will be the only address mentioned. Once every object file has been gone through and their contents stored within memory addresses in an efficient manner by the linker, an executable is produced. Based on a token table similar to the one a compiler uses, the linker can convert the object code to machine instructions, effectively making a program that a computer can actually understand.

And violà! Now the program is an executable written in machine code! Ironically, there was some abstraction in the explanation of how a high-level language goes to machine code, as the technical lingo is extremely difficult to understand. There are legitimate university courses that are dedicated to only talking about how language conversion works and how low-level languages work, so of course, this was only a brief overview of the subject.

Programming Languages and Resources for Web Developers
The easiest way to learn coding is via web design programming. You should lean coding languages that are in use by millions of sites. HTML, CSS (or HTML5 & CSS3) PHP, MySQL, JavaScript (or JS frameworks like jQuery, Angular, React, Node, or Express) or MongoDB, Apache, Ruby on Rails, and Linux are all related to web design coding. For beginners interested in learning more about web design and development, here are a list of step-by-step training guide articles: i- Become CMS specialist, ii- Become front-end specialist, iii- Become expert SQL developer, iv- Become expert PHP developer


Discussed coding languages are well suited for those interested in pursuing a career in web design and development; however, other options are mobile App design and development, system admin and software engineering. It is advisable to consult with an IT counselor to understand what options best fits your skills. For instance, if you want to be a software engineer, learning HTML and CSS might not fit the bill. Here is an excellent article for learning more on coding and technology career roadmap. Once you know what career path you wish to pursue, you can make a plan on what, when, and how to learn. There are lots of online resources for learning coding and technology in general. For teenagers and high school students, High School Technology Services offers variety of hands-on training. For adults and professionals, Coding Bootcamps and DC Web Makers Companies offer basic to advance project-based programming and technology classes.

Article Comments

By Same Author

Learn about computer pointers
How does a Computer Pointer Work
Facebook and breach of user data privacy
Facebook and Personal Data Collection
so many coding languages are out there
Why There Are so Many Programming Languages
Wave-Particle Duality
Wave-Particle Duality and the Double-Slit Experiment
The meaning of 404 error
The 404 Network Error and its Meaning
Learn about computer file processing
How a Computer Recognizes and Treats Different Kinds of Files
Security Vulnerabilities in card processing terminals
Security Vulnerabilities in Point of Sale Terminals
What is CRISPR
What on Earth is Clustered Regularly Interspaced Short Palindromic Repeats
Effects of technology on human evolutions
How Technology will Influence Human Evolution
An introduction to Multiverse Theory
The Multiverse Theory and its Implications

Affiliated Companies

Disclaimers And Things

Copyright © WEG2G, All Rights Reserved
Designed & Developed by DC Web Makers