How Can a Machine Reads a Compiler Since A Compiler is Written in Text! Not Binaries?


 
Thread Tools Search this Thread
Top Forums Programming How Can a Machine Reads a Compiler Since A Compiler is Written in Text! Not Binaries?
# 8  
Old 11-13-2008
I will be reading more about the various terms (bootstrapping, etc) you have posted here...
# 9  
Old 11-13-2008
Quote:
Originally Posted by f.ben.isaac
>>You can write a binary executable directly in hex,

And HEX, so what translates these hexes to binaries for the compiler?
If a agree with you, writing in binary 1 & 0 will make machine understand what do you want to do! There has to be convertion between hexes to binaries and since hex is not binaries, what does the conversion! Machine does not giva a damn to anything else except if there is another binary written as a translator who translates hexes back to binary. Any idea?

I'm very new to this, i ask in a very dummy questions to know the basics - only overview, no technical stuff....

THANKS
That's the job of the assembler. It converts hex strings to machine code in the instruction set of the mpu and ofcourse the separation of data and instructions.
# 10  
Old 11-13-2008
Quote:
Originally Posted by shamrock
That's the job of the assembler. It converts hex strings to machine code in the instruction set of the mpu and ofcourse the separation of data and instructions.

Can you give an example of instruction set of the mpu? Does it look like:
ADD, JMP, etc? If yes, then ADD need to be translated too unless if it inserted directly as 110010 101001 (ADD #), something like that....

Ok assume, we wrote the code from the keyboard in binaries, so kept writing such as 101001 110110 10110100, refers to ADD AX, etc. Can my machine just grab this binaries without the help of any compiler?

I guess the only way to fully understand it, i have to take hardware, and compiler construction courses.

Anyway, I appreciate all of your help members! Well Said, Well Answered
# 11  
Old 11-13-2008
Quote:
Originally Posted by f.ben.isaac
>>You can write a binary executable directly in hex,

And HEX, so what translates these hexes to binaries for the compiler?
Nothing. Hex is binary. No translation needed. It's difficult but not impossible to make rudimentary tools this way, and once you have those, you can use those rudimentary tools to build better ones.
# 12  
Old 11-13-2008
Ok...I see. I have some misunderstandings. Your answer clarified it...
# 13  
Old 11-14-2008
It's like being told to build the Eiffel Tower - and all you have is a simple charcoal forge and some hammers and metal saws. You build tools to make more powerful tools that you use to make really sophisticated tools. Then, finally, you can build the Eiffel Tower.
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Programming

C compiler to build Sparc/Solaris binaries on Linux

Just that the Subject says. I am looking for a C compiler for Linux x86 that will allow me to compile a C source code file and the resulting binary will be able to run on a Sparc running Solaris. Thanks. (2 Replies)
Discussion started by: lyonsd
2 Replies
Login or Register to Ask a Question