摘要
堆栈处理器是一种面向嵌入式控制领域的处理器,其执行过程不依赖于通用寄存器而是硬件堆栈。文中以一款基于FPGA设计的16位堆栈处理器为平台,研究如何将一个C源代码转换成能够被目标处理器汇编器识别的汇编指令。为了能够迅速有效地实现代码生成器,文中选用LCC。LCC是一款可变目标的C编译器,通过重新书写目标处理器的描述文件,LCC可以生成特定处理器的汇编指令。文章的最后通过一个简单的测试证明了C语言是可以移植到堆栈处理器上的。
Stack processor is a processor facing to the field of embedded control, and its implementation process does not depend on general register but hardware stack. Take the 16 stack processor based on FPGA as the platform,research how a C source code can be converted into assembly instruction by target processor assembler recognition, tn order to quickly and effectively achieve the code generator, choose LCC. LCC is one variable target C compiler, through rewriting the description file of the target processor,LCC can generate a particular processor assembly instruction. Finally through a simple test proved that C language can be transplanted to stack on the processor.
出处
《计算机技术与发展》
2013年第4期163-167,共5页
Computer Technology and Development
基金
南京航空航天大学引进人才科研启动基金(S1028-042)