Font Size: a A A

Intermediate Language Based On Virtual Register

Posted on:2010-11-10Degree:MasterType:Thesis
Country:ChinaCandidate:D HanFull Text:PDF
GTID:2178360278959272Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
In embedded system, inline assembly language is often used to increase the efficiency of embedded software instead of high-level language partly, but it is not so portable or readable. To resolve that problem, one kind of intermediate language based on virtual register called VR-IL is designed with some concept and design philosophy of the traditional intermediate language, and it can be mixed with high-level language just like inline assembly language. It can be translated to kinds of target machine languages. Using VR-IL, the disadvantages of inline assembly language are surmounted with nearly the same runtime efficiency. Essentially, the runtime efficiency is achieved with the price of space and runtime compiling cost.On the level of grammar, VR-IL is one kind of programming language based on C language functions, in other words, all VR-IL sentences are in the form of C function, and C function is the basic syntactical unit of VR-IL. On the level of semantics, the purpose of VR-IL program's running is generating intermediate code, and according to role of code generation, VR-IL sentence is sorted into two sets: direct code generation sentence and auxiliary code generation sentence. The intermediate code presents the function of VR-IL.There is map relationship between VR-IL intermediate code and physical instruction, and VR-IL intermediate code consists of operation code and operand just like physical instruction which is called virtual instruction to be differentiated from physical instruction. Virtual instruction is used to mask the difference of different target architecture, and the converting from virtual instruction to physical instruction is done by the back end of runtime compiler. That can meet the requirement of the embedded system with several target architectures.The compiling process is divided into two parts, the first part is static compiling by high level compiler, after that the virtual instructions are generated by the compiled code. The second part is runtime compiling of the generated virtual instructions, and the output of the process is target machine code.A basically complete program language system is explained in this paper and some algorithms of modern compiler theory are implemented. In the end, the runtime comparison of VR-IL, C and ARM inline assembly language is carried out to illustrate the runtime advantage of VR-IL, and it also prove that the design goal is reached. The work done by the subject provides not only a solution to address the shortcomings of embedded assembly language but also a good reference value for the study of modern compiler theory.
Keywords/Search Tags:intermediate language, virtual register, virtual instruction, assembly language
PDF Full Text Request
Related items