Font Size: a A A

The Design And Optimization Of Embedded Cross-assembler

Posted on:2013-08-09Degree:MasterType:Thesis
Country:ChinaCandidate:S C LiuFull Text:PDF
GTID:2248330395485206Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
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.
Keywords/Search Tags:Cross-assembler, Peephole Optimization, Regular Expression, Flex, Software Porting
PDF Full Text Request
Related items