Go Down

Topic: Compilation (Read 4146 times) previous topic - next topic



My question is about compilation.

I'm wondering how you can create a language, how have you succeeded in creating the first "exe code" for the first time.
How have you create this language to be able to manage the hardware.

The problem is well-known in book as "Chicken vs Chiken eggs Problem" here applicated with the "hardware arduino language".

Thank you for the help :)


Jul 10, 2014, 03:11 pm Last Edit: Jul 10, 2014, 03:18 pm by Peter_n Reason: 1
The first compilers are written in assembly, the rest is history. The Arduino is based on the gnu c-compiler which has a long an interesting history.


And later, lex/yacc
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.


The answer as it applies in modern times, is "cross-compilation" where the code for a newer computer is compiled on another, earlier type of computer.

Once you have a computer which can perform this process, you use it to generate programs for whatever system you need to program.  It's just a matter of writing the software to do it once you have a general-purpose tool - which is exactly what computers are all about.


As others have said, you have cross compilers, which is a compiler that runs on one system and generates code for another system.  In fact, when you use a microprocessor with Arduino libraries, you are using a cross compiler, where the compiler runs on the x86 and generates AVR code (or ARM code in the case of Teensy 3.x/DigiX/Due).

When I worked at Cygnus Solutions, which used to do GCC/GDB ports for new chips, we had a third option that we called Canadian cross compiler, where you are building the compiler on one system (such as Sparc Unix at the time), so that the compiler would run on a second system (such as a Windows system running Cygwin), and the compiler would be a cross compiler for a third system.  At the time we created the setup, Canada had 3 political parties that were more or less the the same size and the VP of software engineering had been born in Canada.


Yep yep yep

Thank U very much indeed for all of your answers.

I'd like to find a web link providing me the way the first, the very first compiler has been designed and created.

(I find out mrs Hopper but nothing technical about that first compiler  ]:) )

Thanks for help

see U


You can find some of the stuff for Fortran for the 704 (which is generally considered the first complete compiler in the modern sense of the word) here: http://www.softwarepreservation.org/projects/FORTRAN/.

I recall when I was at the University of Minnesota in 1975-1979, there was a book on the history of 10 languages.  I suspect by now, the book is long out of print, but perhaps now.  Given it was 35+ years ago, I may still have it somewhere (I recall it was one of the books I kept), but I doubt I could find it.


Thanks I read rapidly the text.
I found the point : how was the first Assembly 'Compiler' created for the very first time ?

I'd say the crucial point is how to handle the Inputs (keyboard) and Output (screen and exec code can be seen as an Output for the Assembly Compiler)


It's a good question.

Bootstrapping, it's called. Nowadays everything can be done with cross-compilation. You can also build emulators, so you can write and debug code in a virtual machine environment before any target hardware is built. We used to do this when I worked on mainframes.

So at the root, when you have no compiler, no assembler, no OS to drive keyboard/screen - how do you get the code running ?
You can write an OS or compiler in assembly language. Without an assembler, you have to translate the assembler to octal (or hex) machine code - there were programmers who could do this in their head, and didn't need to look up codes in the handbook.

Now you have code in octal or hex, how do you get that into the computer? The answer is a switch panel. You enter the address, the data, and press store, and the value is written to RAM (or core store :) ) This is how we bootstrapped our mainframes. The bootloader was entered by hand, after power up. Some engineers memorized the whole sequence (it was not many instructions).

The bootloader would then read code from a paper tape say, to fill RAM with a longer bootloader or mini-OS to drive more peripherals. The paper tape can be created with a dumb electromechanical machine, or in the days of punched cards you could do it with a hand punch.

Other ways of getting code into memory were hand weaving - http://en.wikipedia.org/wiki/Core_rope_memory.

The same method was used for mini computers and early microcomputers e.g. http://www.pdp8.net/pdp8i/pics/pdp8i_frontpanel.shtml?large
Please ask questions in the forum so everyone can benefit. PM me for paid work.


I did a summer exchange program in 1978, and I would often have to toggle in the PDP-11 bootloader using 3 finger octal on the front panel (the PDP-11 instruction format lent itself to using octal, since most of the register fields were 3 bits, and the top bit in the 16-bit word indicated whether the instruction was byte oriented or 16-bit word oriented.

I recall recently somebody did a boot of an Arduino class machine, manually setting the clock/data bits by hand toggle switches in setting up the SPI transfer used by the USP.

And back in the day, we didn't have keyboards directly connected to the computer or screens.  I've programmed with punch cards, including 'patching' them using scotch tape and an exacto knife.  I've also programmed via ASR-33 teletypes, and have feed programs in via paper readers on the ASR-33.


:smiley-mr-green: :smiley-mr-green: :smiley-mr-green: :smiley-mr-green: :smiley-mr-green:

Great it is very kind of you guys to give me such informations !!!!!

I copy them on my harddisk because I'm asking it for a vey very long time so THANK YOUUUUUUUUUUUUUUUU !!!!!!!!!


If you want to have a go at building a computer from scratch, have a look at some of the home-built computers, like this one http://www.electronixandmore.com/projects/relaycomputertwo/index.html

Not a practical way to build a computer, but the result is almost like kinetic art.

Please ask questions in the forum so everyone can benefit. PM me for paid work.

Go Up