Developing a compiler for an abstract CPU architecture

OData support
Supervisor:
Dr. Goldschmidt Balázs
Department of Control Engineering and Information Technology

Nowadays security gets an increased role in our lives. Passwords, identification numbers, cameras, sensors are all integral parts of our daily routines and they are for a reason: protection. With the help of modern technology, we often control our physical wards (eg barriers, locks) with software, which gives us an endless pool of opportunities.

The subject of my thesis came about during the implementation of the aforementioned software controlling. Cogitnet Kft. developed their own hardware, that’s capable of taking the role of the controller in different environments. In oder to be able to communicate with the device, to program it, a need arised for a compiler, which can translate an assembly-like language to machine code. At the beginning, they wanted to program the hardware in a Pascalesque language, but due to the short deadlines and the complexity of the task, it did not prove to be feasable.

The development was incremental, it happened iteratively. I always focused on a small, easy problem, which was then expanded step by step with the help of the project leaders. The requirements for the compiler changed from time to time in order to fit the virtual machine which was running on the hardware, or to make the developers life a bit easier, more convenient.

The finished product is able to translate complex code, consisting of multiple files, into flawless machine code which can be interpreted by the virtual machine. During development, the programmer can use some features from high level languages, like casting variables, conditional compiling and parametrized file reading. There are also flags, or switches available, which can modify the process of the compilation or they can help to gain excess information on the output during translation.

Creating a compiler is a hard, complex task. I had to start making one without any previous knowledge or experience, therefore the trained eye can discover many deficiencies. Fixing those and patching other flaws will be a future task.

Downloads

Please sign in to download the files of this thesis.