首页> 外国专利> Mapping assembly language argument list references in translating code for different machine architectures

Mapping assembly language argument list references in translating code for different machine architectures

机译:在针对不同机器架构的翻译代码中映射汇编语言参数列表引用

摘要

A code translator, constructed similar to a compiler, accepts as an input to be translated the assembly code written for one architecture (e. g., VAX), and produces as an output object code for a different machine architecture (e.g., RISC). The input code is converted into an intermediate language, and a flow graph is constructed. The flow graph is referenced by a flow analyzer for recognizing certain architecture- specific and calling standard-specific coding practices or idioms that cannot be automatically converted, particularly relating to stack usage, register usage, condition codes, and passing arguments for procedure calls. By tracking stack usage within routines, the compiler can distinguish up-level stack and return address references from valid local references. Also, it can inform the user of stack misalignment, which has a severe performance penalty, and can detect code segments where different flow paths may result in different stack depths at runtime, which may indicate a source code error. Register usage is likewise tracked to determine which registers are destroyed by a routine, and generate routine prologue and epilogue code which performs register saves, as well as provide register "hints" to aid the user in adding an entry point declaration or documentation for the routine. The usage of condition codes is likewise tracked, by a backward walk through the flow graph, so that code to fabricate needed values is generated. In addition, all argument pointer based memory references in the input code is tracked to determine how the same argument reference may be made in the target environment.
机译:构造类似于编译器的代码翻译器接受针对一种架构(例如,VAX)编写的汇编代码作为待翻译的输入,并生成针对不同机器架构(例如,RISC)的目标代码。将输入代码转换为中间语言,并构造流程图。流程图由流分析器引用,用于识别某些无法自动转换的特定于体系结构和调用标准的编码实践或习惯用法,特别是与堆栈使用,寄存器使用,条件代码以及为过程调用传递参数有关。通过跟踪例程中的堆栈使用情况,编译器可以将上层堆栈和返回地址引用与有效的本地引用区分开。而且,它可以通知用户堆栈不对齐,这会严重影响性能,并且可以检测代码段,其中不同的流路可能会在运行时导致不同的堆栈深度,这可能表示源代码错误。同样跟踪寄存器使用情况,以确定例程破坏了哪些寄存器,并生成例程序言和结语代码以执行寄存器保存,并提供寄存器“提示”以帮助用户添加例程的入口点声明或文档。同样,通过向后浏览流程图来跟踪条件代码的使用,以便生成用于制造所需值的代码。此外,将跟踪输入代码中所有基于参数指针的内存引用,以确定如何在目标环境中进行相同的参数引用。

著录项

  • 公开/公告号US5307492A

    专利类型

  • 公开/公告日1994-04-26

    原文格式PDF

  • 申请/专利权人 DIGITAL EQUIPMENT CORPORATION;

    申请/专利号US19910666085

  • 发明设计人 THOMAS R. BENSON;

    申请日1991-03-07

  • 分类号G06F9/44;

  • 国家 US

  • 入库时间 2022-08-22 04:31:52

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号