The Design and Optimization of Embedded Cross-assembler
- Author
- LiuSongChao
- Advisor
- TanHuaiLiang
- School
- Hunan University
- Major
- Applied Computer Technology
- Classification
- TP314 Compiler,interpreter
- Degree
- Master's thesis
- Year
- 2012
- Downloads
- 18
- Citations
- 0
Abstract
Nowadays, the application of embedded systems has penetrated into all walks oflife. As the core of embedded system, embedded microcontrollers are currently inrapid growth. In order to establish a variety of applications on the chip, the toolchainneeds be developed first. As a key part of the toolchain, cross-assembler plays animportant role. So, how to develop cross-assembler fast and efficiently is essential tothe whole industry. Also, due to the strict requirements of embedded products, theresearch on how to improve the cross-assembler’s optimization ability is becomingmore and more popular.Peephole optimization, a kind of optimization technique, plays an important rolein improving applications’ performance. However, in traditional peepholeoptimization, the size of the sliding window is fixed or has upper limit, which doesn’twork well in identifying a non-continuous sequence of instructions. In this paper, wedescribe how to develop cross-assembler and present a new method for peepholeoptimization. Our work consists of the following parts:First, we design a cross-assembler BJXASM which meets the requirements of theproject. The object code from the cross-assembler runs well in the emulator. BJXASMis constructed by porting and modifying macro assembler GPASM which supportsPIC based architecture.Second, a method is proposed which dynamically binds the information of themicroprocessor. In this way, the information part of the microprocessors is detachedfrom the BJXASM and stored in separate files, which makes the assembler flexibleand scalable.Also, in this paper, a new peephole optimization method is proposed to improvethe optimization ability of the assembler. The new way uses regular expression tomatch those non-continuous instructions and replace them with faster and shorter ones.What is more, some data flow analysis methods are added to help analyzing livevariables and common sub-expressions, which improves the quality of the generatedcode.Finally, we compare the code size and runtime of the optimized programmes withthat of the unoptimized ones. From the experiments, we can see that BJXASMsupports the target machine well, and the newly proposed peephole optimizationmethod effectively reduces the runtime and code size of the programs.
Table of contents
Summary 5-6
Abstract 6-8
directory 8-10
illustrations index 10-11
plug table Index 11-12
Chapter 1 Introduction 12-16
1.1 background 12-13
1.2 assembler Overview 13
1.3 Research Status 13-15
1.4 This work 15
1.5 thesis organization structure 15-16
Chapter 2 assembler -related technical analysis 16-36
2.1 assembler organizational structure 16-25
2.1.1 lexical analysis 16-18
2.1.2 parsing ; 2.1.3 semantic analysis nbsp 18-20
20
2.1.4 target code generation 20-22
2.1.5 symbol table 22-24
2.1.6 error handling 24-25
2.2 compiler optimization technology analysis 25-31
2.2.1 common sub -expression elimination 25-26
2.2.2 dead code elimination 26-27
2.2.3 code mobile 27-28
2.2.4 register allocation 28
2.2.5 instruction scheduling 28-30
2.2.6 peephole optimization 30-31
2.3 compiler construction 31-34
2.3.1 Flex Profile 31-33
2.3.2 Bison Profile 33-34
2.4 Summary 34-36 <br / > constructor Chapter 3 cross-assembler BJXASM of 36-49
3.1 features BJX microcontroller 36-38
3.1.1 register Description 36-37
3.1.2 instruction Set 37
3.1.3 addressing 37-38
3.2 GPASM organizational structure 38-41
core data structure 3.2.1 GPASM of 38-39
structure and workflow 3.2.2 GPASM of 39-41
3.3 BJX cross-assembler structure 41-48
3.3.1 lexical analyzer constructed 41-44
3.3.2 parser construction 44-47
3.3 .3 constructed code generation module 47-48
3.4 Summary compiler optimization 48-49
Chapter 4 BJXASM of 49-68
4.1 Data flow Analysis 49-59
4.1.1 active multivariate analysis methods active variable analysis 49-53
4.1.2 BJXASM method 53 - 55
4.1.3 available expression analysis available expression analysis 55-57
4.1.4 BJXASM method 57-59
4.2 peephole optimization method 59-67
4.2.1 peephole optimization overview 59-63
4.2.2 peephole optimization method based on regular expressions 63-67
4.3 Summary 67-68
Chapter 5 experiments and analysis 68-75
5.1 test environment and performance indicators 68
5.2 testing and performance analysis 68-74
5.2.1 object code size test 69-73
5.2.2 uptime test 73-74
5.3 Summary 74-75
conclusion 75-76
References 76-81
Thanks 81-82
Appendix papers and participation in research projects during the a published study for a degree 82
Related dissertations
- Research on the RIA-based Techniques for Remotely Monitoring and Controlling Experiments
- Research on Key Technologies of Network Traffic Analysis and System Implementation
- Research on the Detection Technology for Vulnerability in Java Web Program Based on Regular Expression
- Design and Realization of P2P Traffic Identification Based on DPI
- Regular-Expression Matching and Optimization Techniques Using Negative Factors
- The Design of Virtual Instrument Program Development Tools Based on Flex
- Network Based Remote Digital Circuit Experiment under Virtual and Real Combination Framework
- The architecture of B/S auto repair technical support system design and Implementation Based on
- Design and implementation of performance assessment system of government based on SOA
- System Analysis and Design on Internet Repair Calling Management of Chongqing Wenli College
- Design and Implementation of Sichuan Conservatory of Music Performing Arts Project Resource Management Information System
- Design and Implementation of Online Examination System Based on Flex and J2EE
- Research and Develop Exquisits Courses Management Platform for Jiujiang Vocational University
- Community Comprehensive Business Information Management Platform for Research and Development
- Design and Implementation of an Assets Management System for a XinJiang Company
- Design and Implementation of Taxation Analysis System Based on Flex and Java
- Development of Virtual Training Platform of B/S-based"Computer Assembly and Maintenalice"
- Design and Implementation of VB Computer Examination System
- The Design and Implementation of Data Center Management Platform Based on FLEX Technology
- Design and Implementation of the System of the Coal Market Information Analysis Based on Silverlight