›› 2014, Vol. 27 ›› Issue (5): 123-.

• 论文 • 上一篇    下一篇

32位MIPS处理器代码生成器的研究与实现

尹娟,孙巧稚   

  1. (南京航空航天大学 计算机科学与技术学院,江苏 南京 210016)
  • 出版日期:2014-05-15 发布日期:2014-05-14
  • 作者简介:尹娟(1989—),女,硕士研究生。研究方向:计算机体系结构和编译技术。E-mail:hyhnnj@nuaa.edu.cn。孙巧稚(1989-),女,硕士研究生。研究方向:计算机体系结构和编译技术等。

Research on and Implement of Code Generation for 32-bit MIPS Processor

YIN Juan,SUN Qiaozhi   

  1. (College of Computer Science and Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 210016,China)
  • Online:2014-05-15 Published:2014-05-14

摘要:

以嵌入式系统编译器LCC和32位MIPS处理器为基础,完成了LCC在目标机MIPS处理器上的移植工作。为迅速有效地生成代码生成器,根据新目标机的特点,将原有的宏汇编指令通过指令拆分和指令间的相互转化技术重新书写机器描述文件,使得生成的目标代码包含的指令集更小,结构更加紧凑。目标代码的操作码约缩小50%,并成功实现C代码到汇编代码的转换,能通过MIPS模拟器PCSPIM的验证,同时性能也得到大幅提高。通过汇编器生成相应的机器码,并用Xilinx ISE自带的仿真软件Isim(ISE Simulator)验证了其正确性,实现LCC在MIPS处理器上的成功移植。

关键词: MIPS, LCC, 代码生成器, PCSPIM, 汇编器, ISim

Abstract:

Based on LCC compiler and embedded system 32-bit MIPS processor,this paper implements the LCC successful transplantation on the target machine MIPS processor.In order to quickly and effectively generate code generator,according to a new target machine features,the original macro assembly instructions area modified through splitting instructions and transforming between instructions,and then the machine description file is rewritten such that the generated object code has smaller instruction set and more compact structure.The opcode of object code is reduced by about 50% and the translation from the C code into assembly code is successfully done and passes the validation of MIPS simulator PCSPIM,while the performance is greatly improved.Finally,the machine code is generated using the assembler to verify the machine code on Xilinx ISE built-in simulation software (ISim) with a successful transplantation of LCC onto MIPS processors.

Key words: MIPS;LCC;code generator;PCSPIM;assembler;ISim

中图分类号: 

  • TP311.54