[go: up one dir, main page]

CN101118498A - Assembler Based on User Description and Its Realization Method - Google Patents

Assembler Based on User Description and Its Realization Method Download PDF

Info

Publication number
CN101118498A
CN101118498A CNA2007100458880A CN200710045888A CN101118498A CN 101118498 A CN101118498 A CN 101118498A CN A2007100458880 A CNA2007100458880 A CN A2007100458880A CN 200710045888 A CN200710045888 A CN 200710045888A CN 101118498 A CN101118498 A CN 101118498A
Authority
CN
China
Prior art keywords
instruction
information
encoding
operand
isa
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA2007100458880A
Other languages
Chinese (zh)
Other versions
CN100541433C (en
Inventor
邹耀
马强
刘佩林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Jiao Tong University
Original Assignee
Shanghai Jiao Tong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Jiao Tong University filed Critical Shanghai Jiao Tong University
Priority to CNB2007100458880A priority Critical patent/CN100541433C/en
Publication of CN101118498A publication Critical patent/CN101118498A/en
Application granted granted Critical
Publication of CN100541433C publication Critical patent/CN100541433C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

一种计算机技术领域的基于用户描述的汇编器及其实现方法,其中:ISA描述模块读入用户描述的指令集体系结构信息,并从用户的描述信息中提取出ISA数据至结构化信息自动配置模块;结构化信息自动配置模块将数据组织成结构化的ISA信息并输出至ISA信息库管理模块;ISA信息库管理模块将该结构化的指令结构信息存放入内存中,并将汇编过程中需要的ISA信息传递给汇编功能处理模块;汇编功能模块读入汇编源文件,并从ISA信息库管理模块得到需要的ISA信息,用于对汇编源文件的处理,最后生成相应的二进制代码文件。本发明还提供上述的汇编器的生成方法,可方便、直观的根据用户对ISA描述,且无需重复编译而即时的生成相应的汇编功能的汇编器。

Figure 200710045888

A user-description-based assembler and its implementation method in the field of computer technology, wherein: the ISA description module reads in the instruction set architecture information described by the user, and extracts ISA data from the user's description information to automatically configure structured information module; the structured information automatic configuration module organizes the data into structured ISA information and outputs it to the ISA information base management module; the ISA information base management module stores the structured instruction structure information into the memory, and will The ISA information is passed to the assembly function processing module; the assembly function module reads the assembly source file, and obtains the required ISA information from the ISA information database management module, which is used to process the assembly source file, and finally generates the corresponding binary code file. The present invention also provides the above-mentioned assembler generating method, which can conveniently and intuitively generate the assembler with corresponding assembler function according to the user's description of the ISA without repeated compiling.

Figure 200710045888

Description

基于用户描述的汇编器及其实现方法 Assembler Based on User Description and Its Realization Method

技术领域technical field

本发明涉及一种计算机技术领域的系统及其实现方法,具体是一种基于用户描述的汇编器及其实现方法。The invention relates to a system in the field of computer technology and its implementation method, in particular to an assembler based on user description and its implementation method.

背景技术Background technique

汇编器是编译系统中重要的组成部分,其主要功能是将用汇编语言编写的源程序转换成二进制形式的目标文件。汇编器的输入为汇编语言程序,这些程序可以是编译器的输出结果,也可能是手写的汇编语言程序。汇编器的输出为二进制的目标文件。The assembler is an important part of the compilation system, and its main function is to convert the source program written in assembly language into a binary form of the object file. The input to an assembler is an assembly language program, which can be the output of a compiler or a handwritten assembly language program. The output of the assembler is a binary object file.

现有的汇编器的设计与实现中,对于不同的指令集体系结构(以下简称ISA)就要开发不同的汇编器以满足不同处理器的要求,这样使得开发新的处理器的时候,就要重新开发与之相应的汇编器。当前,汇编器一般随相应的处理器的开发而协同开发。不同的处理器在指令字长,指令编码方式,寄存器设置等方面都有所不同,使得汇编器在实现和结构上有很大的不同。另外,因为设计思想的差异也会产生的汇编器在实现和方法上的不同。处理器的配置不同以及设计思想的不同而造成了不同ISA的汇编器在结构和实现方法上的差异性。由于这种差异性的存在,对每一种新的ISA或者对原有的ISA进行改进和扩展时,就要同时开发与之相适应的汇编器。汇编器的开发一般具有较高的复杂度和较大的工作量,需要花费较长的时间和较多的精力。在整个编译系统中,汇编器是必不可缺的部分,所以开发一种可以根据用户对某一种ISA的描述而即时产生相应的汇编功能的汇编器,以显著的缩短开发周期,减少工作量和精力的投入,对处理器以及其相应编译系统的开发就具有至关重要的意义。In the design and implementation of existing assemblers, different assemblers must be developed for different instruction set architectures (hereinafter referred to as ISA) to meet the requirements of different processors, so that when developing a new processor, it is necessary to Redevelop the corresponding assembler. Currently, assemblers are typically co-developed with the corresponding processors. Different processors have different instruction word lengths, instruction encoding methods, register settings, etc., which make assemblers very different in implementation and structure. In addition, because of the difference in design ideas, the assembler will also be different in implementation and method. Different configurations of processors and different design ideas lead to differences in the structure and implementation methods of assemblers of different ISAs. Due to the existence of this difference, when improving and expanding each new ISA or the original ISA, it is necessary to develop an assembler adapted to it at the same time. The development of an assembler generally has high complexity and a large workload, and requires a long time and a lot of energy. In the whole compilation system, the assembler is an indispensable part, so develop an assembler that can instantly generate the corresponding assembly function according to the user's description of a certain ISA, so as to significantly shorten the development cycle and reduce the workload The investment of energy and energy is of vital significance to the development of processors and their corresponding compilation systems.

经对现有技术的文献检索发现,坦斯利卡公司于2000年2月4号向中国专利局申请的专利“用于设计可配置的处理器的自动处理器产生系统及其方法”(专利申请号CN00812731)中提到了基于坦斯利卡公司的配置方法的可配置汇编器,该项技术使用坦斯利卡公司开发的指令集体系定义语言对汇编器进行配置,这种方法也可以实现针对不同的ISA生成相应的汇编装置。但使用者使用该公司的可配置汇编器时,必先学会使用其指令集体系描述语言,要生成功能比较完备的指令集体系,需要先花去不小的工作量,以便较为熟练的掌握这种指令集体系定义语言。而且这种语言在对ISA描述时比较抽象,不易被用户所掌握,不具备描述指令集体系结构的简洁性和直观性。同时,坦斯利卡公司的相关专利中,根据其定义语言的ISA将会生成相应的代码文件,然后加入到与ISA信息无关的代码文件中去编译,最后生成汇编器。这样,每次生成不同ISA的汇编器就要重新编译一次,使得在开发过程中花费了比较多的时间在编译过程上。尤其在对ISA做修改的时候,一点微小的修改都要花费大量的时间进行编译。这种方法无疑增加了开发过程的负担。综上,该技术所述的可配置汇编器,其提供给用户的描述方法过于复杂和抽象,不易掌握;每次生成不同ISA的汇编器就要重新编译一次,花费了较多的编译时间。After searching the literature of the prior art, it was found that the patent "Automatic Processor Generation System and Method for Designing a Configurable Processor" (Patent Application number CN00812731) mentioned the configurable assembler based on the configuration method of Tansilika Company, this technology uses the instruction set system definition language developed by Tansilika Company to configure the assembler, and this method can also realize Generate corresponding assemblers for different ISAs. However, when users use the company's configurable assembler, they must first learn to use its instruction set system description language. To generate a relatively complete instruction set system, it is necessary to spend a lot of work in order to master it more proficiently. An instruction set architecture definition language. Moreover, this language is relatively abstract when describing the ISA, and is not easy to be mastered by users. It does not have the simplicity and intuition of describing the instruction set architecture. At the same time, in the relevant patents of Tansilika, the ISA of its definition language will generate corresponding code files, and then add them to code files that have nothing to do with ISA information to compile, and finally generate an assembler. In this way, every time an assembler with a different ISA is generated, it needs to be recompiled once, which makes it take a lot of time in the compilation process during the development process. Especially when making changes to the ISA, a small change will take a lot of time to compile. This approach undoubtedly increases the burden on the development process. To sum up, the configurable assembler described in this technology provides users with too complex and abstract description method, which is difficult to master; every time an assembler with different ISA is generated, it needs to be recompiled, which takes a lot of compilation time.

发明内容Contents of the invention

本发明针对现有技术的不足,提出了一种基于用户描述的汇编器及其实现方法,使其可以方便、直观的根据用户对ISA描述,并且无需重复编译而即时的生成相应的汇编功能的汇编器,以大大减少开发与新的指令集体系结构相对应的汇编器的开发时间和开发难度。Aiming at the deficiencies in the prior art, the present invention proposes an assembler based on user description and its implementation method, so that it can conveniently and intuitively describe the ISA according to the user, and generate corresponding assembly functions in real time without repeated compiling. Assemblers to greatly reduce the development time and difficulty of developing assemblers corresponding to new instruction set architectures.

本发明是通过以下技术方案实现的:The present invention is achieved through the following technical solutions:

本发明所述的基于用户描述的汇编器,包括:ISA描述模块,结构化信息自动配置模块,ISA信息库管理模块,以及汇编功能处理模块。所述ISA描述模块读入用户描述的指令集体系结构信息,并从用户的描述信息中提取出ISA数据至结构化信息自动配置模块;所述结构化信息自动配置模块将数据组织成结构化的ISA信息并输出至ISA信息库管理模块;所述ISA信息库管理模块将该结构化的指令结构信息存放入内存中以完成ISA的定义,并将汇编过程中需要的ISA信息传递给汇编功能处理模块;所述汇编功能模块读入汇编源文件,并从ISA信息库管理模块得到需要的ISA信息,用于对汇编源文件的处理,最后生成相应的二进制代码文件。The assembler based on user description in the present invention includes: an ISA description module, a structured information automatic configuration module, an ISA information library management module, and a compilation function processing module. The ISA description module reads in the instruction set architecture information described by the user, and extracts the ISA data from the user's description information to the structured information automatic configuration module; the structured information automatic configuration module organizes the data into a structured The ISA information is output to the ISA information base management module; the ISA information base management module stores the structured instruction structure information in the memory to complete the definition of the ISA, and passes the ISA information required in the assembly process to the assembly function for processing module; the assembly function module reads in the assembly source file, and obtains the required ISA information from the ISA information base management module for processing the assembly source file, and finally generates a corresponding binary code file.

所述的ISA描述模块中,用户只需要将ISA信息按照规范填入规范化的表格就可完成对ISA的描述,具体使用的表格包括:指令类型表,助记符编码表,后缀编码表,操作数编码表,一般目的寄存器编码表和特殊目的寄存器表。其中:所述的指令类型表用于描述ISA的不同指令类型的信息;所述的助记符编码表用于描述属于某一指令类型的指令助记符的二进制编码信息;所述的后缀编码表用于描述属于某一指令类型的指令所使用的后缀的二进制编码信息;所述的操作数编码表用于描述属于某一指令类型的指令所使用的操作数的二进制编码信息;所述的一般目的寄存器表用于描述该ISA使用的一般目的寄存器的信息;所述的特殊目的寄存器表用于描述该ISA使用的特殊目的寄存器的信息;In the ISA description module, the user only needs to fill in the ISA information in a standardized form according to the specifications to complete the description of the ISA. The specific forms used include: instruction type table, mnemonic code table, suffix code table, operation Number code table, general purpose register code table and special purpose register table. Wherein: the instruction type table is used to describe the information of different instruction types of the ISA; the mnemonic code table is used to describe the binary code information of the instruction mnemonics belonging to a certain instruction type; the suffix code The table is used to describe the binary encoding information of the suffix used by the instruction belonging to a certain instruction type; the said operand encoding table is used to describe the binary encoding information of the operand used by the instruction belonging to a certain instruction type; the said The general-purpose register table is used to describe the information of the general-purpose registers used by the ISA; the special-purpose register table is used to describe the information of the special-purpose registers used by the ISA;

所述的结构化信息自动配置模块中,将含有ISA相关信息的基本结构组织成结构化的定义,每一个ISA指令类型都将对应一个指令结构,用于描述该类型指令的所有信息。该类型指令的指令结构中的操作码属性为一个操作码结构,该操作码结构的指令助记符名称列表记录了属于该指令类型的所有指令助记符名称,指令助记符编码列表按照指令助记符名称列表中助记符的顺序记录了指令助记符的编码信息,后缀列表属性对应了一组指令操作数结构用来记录该指令类型所使用的后缀信息。指令结构的操作数属性对应了一组指令操作数结构用来记录该指令类型所使用的操作数信息。所用的二进制编码信息都保存在指令编码通用结构中。In the structured information automatic configuration module, the basic structure containing ISA-related information is organized into a structured definition, and each ISA instruction type will correspond to an instruction structure, which is used to describe all information of this type of instruction. The opcode attribute in the instruction structure of this type of instruction is an opcode structure. The instruction mnemonic name list of this opcode structure records all the instruction mnemonic names belonging to this instruction type. The instruction mnemonic code list follows the instruction The sequence of mnemonics in the mnemonic name list records the encoding information of the instruction mnemonics, and the suffix list attribute corresponds to a set of instruction operand structures used to record the suffix information used by the instruction type. The operand attribute of the instruction structure corresponds to a group of instruction operand structures used to record the operand information used by the instruction type. All binary encoding information used is stored in the instruction encoding common structure.

所述的ISA信息库管理模块,包括ISA定义子模块和指令集体系搜索子模块。所述的ISA定义子模块跟据由结构化信息自动配置模块传输来的ISA代码信息的大小和结构,动态申请内存以存放这些代码信息,并根据上段所述的本发明定义的通用的ISA结构方法中的ISA定义方法实现对ISA的定义;所述的指令集体系搜索子模块按照汇编功能处理模块的需要搜索内存中的定义的ISA,并将需要的信息输出给汇编功能处理模块。The ISA information base management module includes an ISA definition submodule and an instruction set system search submodule. According to the size and structure of the ISA code information transmitted by the structured information automatic configuration module, the described ISA definition sub-module dynamically applies for memory to store these code information, and according to the general ISA structure defined by the present invention described in the previous paragraph The ISA definition method in the method implements the definition of the ISA; the instruction set system search submodule searches the defined ISA in the memory according to the needs of the assembly function processing module, and outputs the required information to the assembly function processing module.

所述的汇编功能处理模块,用于对汇编源文件执行实际的汇编功能,这个模块不包含ISA的相关信息,在其执行汇编过程中,ISA的相关信息将通过向ISA信息库管理模块获得。该模块从汇编源文件中读入读取汇编指令,并通知ISA信息库管理模块搜索内存中的ISA的定义,从中提取需要的信息,按照上述的本发明定义的通用的ISA结构方法中的ISA解析的方法将汇编指令解析出来,并完成二进制指令代码的编码,最后输出二进制指令代码文件。The assembly function processing module is used to perform the actual assembly function on the assembly source file. This module does not contain the relevant information of the ISA. During the assembly process, the relevant information of the ISA will be obtained from the ISA information base management module. This module reads in and reads assembly instructions from the assembly source file, and notifies the ISA information library management module to search for the definition of the ISA in the internal memory, and extracts the required information therefrom, according to the ISA in the general ISA structure method defined by the present invention above The method of parsing parses out the assembly instruction, completes the encoding of the binary instruction code, and finally outputs the binary instruction code file.

本发明所述的基于用户的汇编器的实现方法,包括以下步骤:The realization method based on the assembler of user described in the present invention, comprises the following steps:

第一步,编译本发明所述的基于用户描述的汇编器的源程序;The first step, compiling the source program of the assembler based on the user description described in the present invention;

第二步,用户使用本发明定义的一种简洁,易行并且直观的对ISA的描述方法对ISA进行描述,用户只需要将ISA信息按照规范填入规范化的表格就可完成对ISA的描述;In the second step, the user uses a simple, easy and intuitive description method for ISA defined by the present invention to describe the ISA, and the user only needs to fill in the ISA information in the standardized form according to the specification to complete the description of the ISA;

第三步,将用户对ISA的描述中的相关数据提取出来;The third step is to extract the relevant data in the user's description of the ISA;

第四步,将提取出来的ISA相关数据组织成一种高度通用的,可扩展的,能够提供良好的接口以满足指令的扩展需求,同时有利于高效的汇编器指令解析和编码的结构化的ISA信息结构;The fourth step is to organize the extracted ISA-related data into a highly versatile, extensible structured ISA that can provide a good interface to meet the expansion requirements of instructions, and is conducive to efficient assembler instruction parsing and encoding information structure;

第五步,将组织后的ISA信息,按照其大小和结构,动态的存放入内存中,采用步骤四中所述的基于基本结构的指令定义的方法完成对ISA的定义;In the fifth step, the organized ISA information is dynamically stored in the memory according to its size and structure, and the definition of the ISA is completed by using the method of instruction definition based on the basic structure described in step 4;

第六步,读取汇编源代码并对每条汇编指令做逐一的汇编处理,从汇编指令中获取相关的ISA线索信息;The sixth step is to read the assembly source code and assemble each assembly instruction one by one, and obtain relevant ISA clue information from the assembly instruction;

第七步,根据线索信息从内存中的ISA定义中提取需要的ISA信息;The seventh step is to extract the required ISA information from the ISA definition in the memory according to the clue information;

第八步,根据ISA信息,采用步骤四中所述的基于基本结构和指令定义的指令解析的方法完成对汇编指令的解析并最终完成对二进制指令的编码;The eighth step, according to the ISA information, adopt the method of instruction analysis based on the basic structure and instruction definition described in step 4 to complete the analysis of the assembly instruction and finally complete the encoding of the binary instruction;

第九步,完成汇编源代码中所有的汇编指令的处理,输出二进制代码文件;The ninth step is to complete the processing of all assembly instructions in the assembly source code, and output the binary code file;

第十步,若要重新生成新的ISA的汇编器,则转至第二步重新开始,即可完成相应的汇编功能,无需重新编译。In the tenth step, if you want to regenerate the new ISA assembler, go to the second step to start again, and you can complete the corresponding assembly function without recompiling.

第二步所述的规范化的表格,包括:指令类型表,助记符编码表,后缀编码表,操作数编码表,一般目的寄存器编码表和特殊目的寄存器表。一套指令集体系结构描述只有一个指令类型表,一个一般目的寄存器表,一个特殊目的寄存器表。指令类型表中的每一个指令类型将对应一个助记符编码表,一个后缀编码表,一个操作数编码表,用来描述该类型的指令的操作码和操作数的信息。The standardized table described in the second step includes: instruction type table, mnemonic code table, suffix code table, operand code table, general purpose register code table and special purpose register table. An instruction set architecture description has only one instruction type table, one general purpose register table, and one special purpose register table. Each instruction type in the instruction type table will correspond to a mnemonic code table, a suffix code table, and an operand code table, which are used to describe the operation code and operand information of this type of instruction.

其中:in:

指令类型表用于描述ISA的不同指令类型的信息,包括:指令类型的名称,该类型指令所带的操作数的数量,能使用的后缀数目,指令类型的标识,操作数的类型,该指令类型使用的前缀六个属性。The instruction type table is used to describe the information of different instruction types of ISA, including: the name of the instruction type, the number of operands carried by this type of instruction, the number of suffixes that can be used, the identifier of the instruction type, the type of the operand, the instruction Types use the prefix six attributes.

助记符编码表用于描述属于某一指令类型的指令助记符的二进制编码信息,包括:助记符名称,每段助记符编码起始位置,每段的编码的长度,助记符编码被分割的段数,助记符的编码五个属性。The mnemonic encoding table is used to describe the binary encoding information of the instruction mnemonics belonging to a certain instruction type, including: the name of the mnemonic, the starting position of each mnemonic encoding, the length of each encoding, and the mnemonic Encodes the number of segments to be divided, and encodes five attributes of the mnemonic.

后缀编码表用于描述属于某一指令类型的指令所使用的后缀的二进制编码信息,包括:  后缀名称,每段后缀编码起始位置,每段的编码的长度,后缀编码被分割的段数,后缀的编码,该后缀所属的类型六个属性。The suffix encoding table is used to describe the binary encoding information of the suffix used by the instruction belonging to a certain instruction type, including: suffix name, the starting position of each suffix encoding, the length of each encoding segment, the number of segments for which the suffix encoding is divided, and the suffix An encoding of the six attributes of the type to which the suffix belongs.

操作数编码表用于描述属于某一指令类型的指令所使用的操作数的二进制编码信息,包括:操作数的类型名称,每段操作数编码起始位置,每段的编码的长度,助记符编码被分割的段数,操作数的编码,立即数的值是否为相对于当前指令的偏移量标识,立即数的重定位的类型,立即数的特殊处理方式八个属性。立即数的值是否为相对于当前指令的偏移量标识,立即数的重定位的类型,立即数的特殊处理方式都和立即数的重定位有关,当操作数为寄存器时,这三项无效。The operand encoding table is used to describe the binary encoding information of operands used by instructions belonging to a certain instruction type, including: the type name of the operand, the starting position of each operand encoding, the length of each encoding, and mnemonic There are eight attributes including the number of segments where the symbol code is divided, the code of the operand, whether the value of the immediate value is an offset identifier relative to the current instruction, the type of relocation of the immediate value, and the special processing method of the immediate value. Whether the value of the immediate value is an offset identifier relative to the current instruction, the type of relocation of the immediate value, and the special processing method of the immediate value are all related to the relocation of the immediate value. When the operand is a register, these three items are invalid .

一般目的寄存器表用于描述该ISA使用的一般目的寄存器的信息,包括:寄存器的标识名,寄存器的起始编号,寄存器的终止编号,寄存器别名对应关系描述四个属性构成。The general-purpose register table is used to describe the information of the general-purpose registers used by the ISA, including: the identification name of the register, the start number of the register, the end number of the register, and the corresponding relationship between register aliases to describe four attributes.

特殊目的寄存器表用于描述该ISA使用的特殊目的寄存器的信息,包括:特殊目的寄存器的名称,每段特殊目的寄存器编码起始位置,每段的编码的长度,特殊目的寄存器编码被分割的段数,特殊目的寄存器的编码五个属性构成。The special-purpose register table is used to describe the information of the special-purpose registers used by the ISA, including: the name of the special-purpose register, the starting position of each special-purpose register code, the length of each code, and the number of segments where the special-purpose register code is divided , the encoding of the special purpose register consists of five attributes.

第四步所述的结构化的ISA信息结构采用一种通用的可扩展ISA的结构方法,主要用于ISA的定义和ISA指令的解析。该方法包括一组用于指令定义和指令解析的基本结构,基于上述基本结构的指令定义的方法(即第五步中采用的方法),和基于上述基本结构和指令定义的指令解析的方法(即第八步中采用的方法)。在第四步中,数据将被组织成上述基本结构。The structured ISA information structure described in the fourth step adopts a general and extensible ISA structure method, which is mainly used for the definition of ISA and the analysis of ISA instructions. The method includes a set of basic structures for instruction definition and instruction analysis, a method for instruction definition based on the above-mentioned basic structure (that is, the method adopted in the fifth step), and a method for instruction analysis based on the above-mentioned basic structure and instruction definition ( That is, the method adopted in the eighth step). In the fourth step, the data will be organized into the above basic structure.

所述用于指令定义和指令解析的基本结构包括:指令结构,指令编码的通用结构,指令操作码结构和指令操作数结构,其中:The basic structure used for instruction definition and instruction analysis includes: instruction structure, general structure of instruction encoding, instruction opcode structure and instruction operand structure, wherein:

指令结构描述了属于同样类型的指令的全部信息。它包括:指令类型,操作码,操作数组,操作数数量,格式描述五个基本属性。其中,操作码属性为指令操作码结构,操作数组属性为指令操作数结构的数组。An instruction structure describes all information about an instruction belonging to the same type. It includes five basic attributes: instruction type, opcode, operand array, number of operands, and format description. Wherein, the opcode attribute is an instruction opcode structure, and the operation array attribute is an array of instruction operand structures.

指令编码通用结构描述和记录了域的位置以及域对应的具体机器编码。它包含了四个属性:域开始位置数组,域长度数组,域分段数量和域值。The general structure of the instruction encoding describes and records the location of the fields and the specific machine codes corresponding to the fields. It contains four attributes: field start position array, field length array, field segment number and field value.

指令操作码结构用于描述指令操作码信息,其属性包括:前缀名称,指令助记符名称列表,指令助记符编码列表,指令助记符名称列表长度,后缀列表,后缀类型个数。其中,指令助记符编码列表为指令编码的通用数据结构的数组,后缀列表为指令操作数结构的数组,用于描述后缀这种特殊的操作数。The instruction opcode structure is used to describe the instruction opcode information, and its attributes include: prefix name, instruction mnemonic name list, instruction mnemonic encoding list, instruction mnemonic name list length, suffix list, and number of suffix types. Among them, the instruction mnemonic encoding list is an array of common data structures encoded by instructions, and the suffix list is an array of instruction operand structures, which are used to describe special operands such as suffixes.

指令操作数结构描述包括寄存器操作数,立即数操作数,特殊操作数和寻址方式等操作数的信息,其属性包括:类型定义,操作数名称列表,操作数编码列表,复合操作数指针,重定位类型,相对跳转标志。其中,操作数编码列表为指令编码的通用数据结构的数组。The instruction operand structure description includes information about register operands, immediate operands, special operands and addressing modes, and its attributes include: type definition, operand name list, operand encoding list, composite operand pointer, Relocation type, relative jump flag. Wherein, the operand encoding list is an array of common data structures of instruction encoding.

第五步所述的基于基本结构的指令定义的方法,是指:将含有ISA相关信息的基本结构组织成结构化的定义。在该方法中,每一个ISA指令类型都将对应一个指令结构,用于描述该类型指令的所有信息。该类型指令的指令结构中的操作码属性为一个操作码结构,该操作码结构的指令助记符名称列表记录了属于该指令类型的所有指令助记符名称,指令助记符编码列表按照指令助记符名称列表中助记符的顺序记录了指令助记符的编码信息,后缀列表属性对应了一组指令操作数结构用来记录该指令类型所使用的后缀信息。指令结构的操作数属性对应了一组指令操作数结构用来记录该指令类型所使用的操作数信息。所用的二进制编码信息(包括指令助记符,后缀,操作数),都保存在指令编码通用结构中。The method of instruction definition based on the basic structure described in the fifth step refers to organizing the basic structure containing ISA-related information into a structured definition. In this method, each ISA instruction type will correspond to an instruction structure, which is used to describe all information of this type of instruction. The opcode attribute in the instruction structure of this type of instruction is an opcode structure. The instruction mnemonic name list of this opcode structure records all the instruction mnemonic names belonging to this instruction type. The instruction mnemonic code list follows the instruction The sequence of mnemonics in the mnemonic name list records the encoding information of the instruction mnemonics, and the suffix list attribute corresponds to a set of instruction operand structures used to record the suffix information used by the instruction type. The operand attribute of the instruction structure corresponds to a group of instruction operand structures used to record the operand information used by the instruction type. The used binary encoding information (including instruction mnemonics, suffixes, and operands) is stored in the instruction encoding general structure.

第八步所述的基于基本结构和指令定义的指令解析的方法,是指:对于每一条汇编指令,词法分析其操作码(包含指令助记符和后缀),操作数,并将分析得到的信息填充入基于基本结构的指令解析结构中去。该结构使用一个指令结构,将该汇编指令的操作码信息填充入指令结构的操作码属性所对应的操作码结构中去,同时将该汇编指令的操作数信息填充入指令结构的操作数属性所对应的一组操作数结构中去。根据指令助记符和操作数找到与该指令相符合的指令类型,根据指令类型查找符合该指令类型的指令定义表并确定操作码操作数的具体编码定义(以通用编码结构存放),填充入指令解析结构中去。依次扫描数据域编码中的通用编码结构完成最后的指令编码。The method of instruction parsing based on the basic structure and instruction definition described in the eighth step refers to: for each assembly instruction, lexical analysis of its opcode (comprising instruction mnemonic and suffix), operand, and analyzing the obtained The information is populated into the instruction parsing structure based on the basic structure. This structure uses an instruction structure, fills the opcode information of the assembly instruction into the opcode structure corresponding to the opcode attribute of the instruction structure, and at the same time fills the operand information of the assembly instruction into the operand attribute of the instruction structure Go to the corresponding set of operand structures. Find the instruction type that matches the instruction according to the instruction mnemonic and the operand, look up the instruction definition table that matches the instruction type according to the instruction type, and determine the specific encoding definition of the opcode operand (stored in a general encoding structure), fill in Instruction parsing structure to go. The general coding structure in the data field coding is scanned sequentially to complete the final instruction coding.

第十步所述的重新生成新的ISA的汇编器,其方法为:基于用户描述的ISA信息存放在内存中,从而在生成新的汇编功能的汇编器时,只需要把用户描述的相应的ISA指令信息结构化存放入内存供汇编过程使用,即可完成相应的汇编功能,而无需通过重新编译的方法生成汇编器,节省了开发过程中大量的编译时间。The method of regenerating a new ISA assembler described in the tenth step is: based on the ISA information described by the user, it is stored in the memory, so that when generating a new assembly function assembler, only the corresponding user-described The ISA instruction information is structured and stored in the memory for use in the assembly process, and the corresponding assembly function can be completed without recompiling to generate an assembler, which saves a lot of compilation time in the development process.

与现有技术相比,本发明具有以下有益效果:本发明采用用户填写规范化的表格描述相关指令集体系结构,这种方法简单,易行,并且直观,只要了解ISA架构的信息,无需掌握复杂的描述语言,就可以方便的描述ISA。这些规范化的表格具有高度的通用性,满足现今各种指令集体系结构的描述要求。本发明采用了一种通用的可扩展的ISA结构,最大限度的支持现有的指令集体系结构的需求和设计思想,满足各种指令集体系结构的汇编器的开发需要,使得汇编器的开发时间和开发的劳动量大大下降。同时,在新的ISA汇编器的生成过程中,采用免编译的方法,节省了开发过程中大量的开发时间。Compared with the prior art, the present invention has the following beneficial effects: the present invention uses the user to fill in a standardized form to describe the architecture of the relevant instruction set. Description language, you can easily describe the ISA. These normalized tables are highly versatile and meet the description requirements of various instruction set architectures today. The present invention adopts a general scalable ISA structure, supports the requirements and design ideas of the existing instruction set architecture to the greatest extent, satisfies the development needs of assemblers of various instruction set architectures, and makes the development of assemblers The time and labor of development is greatly reduced. At the same time, in the generation process of the new ISA assembler, the method of exempting compilation is adopted, which saves a lot of development time in the development process.

附图说明Description of drawings

图1基于用户描述的汇编器的结构示意图;Figure 1 is a schematic structural diagram of an assembler based on user descriptions;

图2用于描述ISA的规范划的表格的结构示意图;FIG. 2 is a schematic structural diagram of a table used to describe the specification plan of the ISA;

图3通用的可扩展ISA的结构方法中的基本结构的结构示意图;Fig. 3 is a structural schematic diagram of the basic structure in the general scalable ISA structural method;

图4通用的可扩展ISA的结构方法中的指令定义的方法的示意图;Fig. 4 is a schematic diagram of the method of instruction definition in the structure method of general extensible ISA;

图5通用的可扩展ISA的结构方法中的指令解析的方法的示意图;Fig. 5 is a schematic diagram of a method for instruction parsing in a general scalable ISA structure method;

具体实施方式Detailed ways

下面结合附图对本发明的实施例作详细说明:本实施例在以本发明技术方案为前提下进行实施,给出了详细的实施方式和具体的操作过程,但本发明的保护范围不限于下述的实施例。The embodiments of the present invention are described in detail below in conjunction with the accompanying drawings: this embodiment is implemented on the premise of the technical solution of the present invention, and detailed implementation methods and specific operating procedures are provided, but the protection scope of the present invention is not limited to the following the described embodiment.

如图1所示,本发明实施例汇编器包括:ISA描述模块,结构化信息自动配置模块,ISA信息库管理模块,以及汇编功能处理模块。其中ISA信息库管理模块又包括ISA定义子模块,和指令集体系搜索子模块。As shown in FIG. 1 , the assembler of the embodiment of the present invention includes: an ISA description module, a structured information automatic configuration module, an ISA information library management module, and an assembly function processing module. The ISA information base management module includes an ISA definition submodule and an instruction set system search submodule.

ISA描述模块将读入用户描述的指令集体系结构信息,并输出从中提取出的相关数据至结构化信息自动配置模块;结构化信息自动配置模块将数据组织成结构化的ISA信息并输出至ISA信息库管理模块;ISA信息库管理模块中的ISA定义子模块将该结构化的指令结构信息存放入内存中,指令集体系搜索子模块在内存中的ISA定义信息中搜索汇编过程中需要的ISA信息,并传递给汇编功能处理模块;汇编功能模块读入汇编源文件,并从指令集体系库管理模块得到需要的ISA信息,用于对汇编源文件的处理,最后生成相应的二进制代码文件。The ISA description module will read in the instruction set architecture information described by the user, and output the relevant data extracted from it to the structured information automatic configuration module; the structured information automatic configuration module organizes the data into structured ISA information and outputs it to the ISA Information base management module; the ISA definition sub-module in the ISA information base management module stores the structured instruction structure information in the memory, and the instruction set system search sub-module searches the ISA definition information in the memory for the ISA required in the assembly process The information is passed to the assembly function processing module; the assembly function module reads the assembly source file, and obtains the required ISA information from the instruction set system library management module for processing the assembly source file, and finally generates the corresponding binary code file.

下面结合附图2~5,以本发明的装置和方法在开发ARM处理器的汇编指令集汇编器的应用为例,对本发明的技术方案做进一步的详细描述。ARM处理器具有32位的ARM指令集和16位的Thumb指令集,本实例中采用32位的ARM指令集开发其相应汇编功能的汇编器。过程叙述如下:Below in conjunction with accompanying drawings 2-5, take the application of the device and method of the present invention in developing an assembly instruction set assembler of an ARM processor as an example, and further describe the technical solution of the present invention in detail. The ARM processor has a 32-bit ARM instruction set and a 16-bit Thumb instruction set. In this example, the 32-bit ARM instruction set is used to develop an assembler with corresponding assembly functions. The process is described as follows:

首先编译本发明所述的基于用户描述的汇编器的源程序,生成这部分源程序不包含具体的ISA信息。First compile the source program based on the user-described assembler described in the present invention, and generate this part of the source program without specific ISA information.

如图2所示为用户对ISA进行描述时所填写的规范划的表格及这些表格之间的关系。用户需要将一个ISA的相关信息按照如下方式填写入这些表格中去。这些表格包括:指令类型表,助记符编码表,后缀编码表,操作数编码表,一般目的寄存器编码表和特殊目的寄存器表。一套指令集体系结构描述只有一个指令类型表,一个一般目的寄存器表,一个特殊目的寄存器表。指令类型表中的每一个指令类型将对应一个助记符编码表,一个后缀编码表,一个操作数编码表,用来描述该类型的指令的操作码和操作数的信息。As shown in Figure 2, it shows the standardized tables filled in by the user when describing the ISA and the relationship between these tables. Users need to fill in the relevant information of an ISA into these forms as follows. These tables include: Instruction Type Table, Mnemonic Code Table, Suffix Code Table, Operand Code Table, General Purpose Register Code Table, and Special Purpose Register Table. An instruction set architecture description has only one instruction type table, one general purpose register table, and one special purpose register table. Each instruction type in the instruction type table will correspond to a mnemonic code table, a suffix code table, and an operand code table, which are used to describe the operation code and operand information of this type of instruction.

32位ARM指令多种不同的指令类型,相同指令类型的指令带有相同数目和类型操作数,相同的指令字长,并且其操作符和操作数具有相同编码位置。将这些指令类型的信息填写入指令类型表,该表格包含六个属性,描述了指令类型的名称,该类型指令所带的操作数的数量,能使用的后缀数目,指令类型的标识,操作数的类型,该指令类型使用的前缀等指令类型方面的信息。32-bit ARM instructions have many different instruction types, and instructions of the same instruction type have the same number and type of operands, the same instruction word length, and their operators and operands have the same encoding position. Fill in the information of these instruction types into the instruction type table, which contains six attributes, describing the name of the instruction type, the number of operands carried by this type of instruction, the number of suffixes that can be used, the identification of the instruction type, and the number of operands The type of the instruction type, the prefix used by the instruction type and other information about the instruction type.

ARM指令集的每一个指令类型的指令的具体信息,将由用户填写到相应的一个助记符编码表,一个后缀编码表和一个操作数编码表中。其中,助记符编码表记录了属于该类型的每条指令的助记符的二进制编码信息,包括每段助记符编码起始位置,每段的编码的长度,助记符编码被分割的段数,助记符的编码。后缀编码表记录了属于该类型的指令所使用的后缀的二进制编码信息,包括每段后缀编码起始位置,每段的编码的长度,后缀编码被分割的段数,后缀的编码,该后缀所属的类型。操作数编码表记录了属于该类型的指令的操作数的编码信息,包括每段操作数编码起始位置,每段的编码的长度,助记符编码被分割的段数,操作数的编码,立即数的值是否为相对于当前指令的偏移量标识,立即数的重定位的类型,立即数的特殊处理方式。立即数的值是否为相对于当前指令的偏移量标识,立即数的重定位的类型,立即数的特殊处理方式都和立即数的重定位有关,当操作数为寄存器时,这三项无效。The specific information of each instruction type in the ARM instruction set will be filled in by the user into a corresponding mnemonic code table, a suffix code table and an operand code table. Among them, the mnemonic code table records the binary code information of the mnemonic of each instruction belonging to this type, including the starting position of each mnemonic code, the length of each code, and the division of the mnemonic code. Number of segments, encoding of the mnemonic. The suffix code table records the binary code information of the suffix used by this type of instruction, including the starting position of each suffix code, the length of each code segment, the number of segments the suffix code is divided into, the code of the suffix, and the suffix to which the suffix belongs. type. The operand encoding table records the encoding information of the operands of this type of instruction, including the start position of each operand encoding, the length of each encoding, the number of segments where the mnemonic encoding is divided, the encoding of the operand, and the immediate Whether the value of the number is an offset identifier relative to the current instruction, the relocation type of the immediate value, and the special processing method of the immediate value. Whether the value of the immediate value is an offset identifier relative to the current instruction, the type of relocation of the immediate value, and the special processing method of the immediate value are all related to the relocation of the immediate value. When the operand is a register, these three items are invalid .

ARM指令集中使用了一些一般目的寄存器,和特殊目的寄存器,用户需要将这些寄存器的信息填写到一般目的寄存器表和特殊目的寄存器表,用于表示这些寄存器的信息。其中,一般目的寄存器表包含了寄存器的标识名,寄存器的起始编号,寄存器的终止编号,寄存器别名对应关系描述等信息。而特殊目的寄存器表则描述了特殊目的寄存器的二进制编码信息,包括编码起始位置,每段的编码的长度,特殊目的寄存器编码被分割的段数,特殊目的寄存器的编码。Some general-purpose registers and special-purpose registers are used in the ARM instruction set. Users need to fill in the information of these registers in the general-purpose register table and special-purpose register table to represent the information of these registers. Wherein, the general-purpose register table includes the identification name of the register, the start number of the register, the end number of the register, the description of the corresponding relationship of the register alias, and the like. The special purpose register table describes the binary encoding information of the special purpose register, including the encoding start position, the length of each segment of the encoding, the number of segments into which the special purpose register encoding is divided, and the encoding of the special purpose register.

ISA描述模块将读入描述ISA的上述表格的信息,并提取出相关的ISA数据输送至结构化信息自动配置模块。The ISA description module reads the information in the above table describing the ISA, extracts relevant ISA data and sends it to the structured information automatic configuration module.

结构化信息自动配置模块将这些数据组织成结构化的ISA代码信息。这些ISA代码信息为本发明采用的一种通用的可扩展ISA的结构方法中的基本结构。这种通用的可扩展ISA的结构方法,用于ISA的定义和ISA指令的解析。该方法包括一组用于指令定义和指令解析的基本结构,基于上述基本结构的指令定义的方法,和基于上述基本结构和指令定义的指令解析的方法。其中,指令定义方法和指令解析方法将在接下来的过程中使用。The structured information automatic configuration module organizes these data into structured ISA code information. The ISA code information is the basic structure in a general scalable ISA structure method adopted by the present invention. This general and extensible ISA structure method is used for the definition of ISA and the parsing of ISA instructions. The method includes a set of basic structures for instruction definition and instruction analysis, a method for instruction definition based on the above basic structure, and a method for instruction analysis based on the above basic structure and instruction definition. Among them, the instruction definition method and the instruction analysis method will be used in the following process.

如图3,上述的基本结构,包括:指令结构,指令编码的通用结构,指令操作码结构和指令操作数结构。As shown in Figure 3, the above-mentioned basic structure includes: instruction structure, general structure of instruction encoding, instruction opcode structure and instruction operand structure.

指令结构描述了属于同样类型的指令的全部信息:指令类型的名称,操作码,操作数组,操作数数量,格式描述。其中,操作码为指令操作码结构,操作数组为指令操作数结构的集合,格式描述将描述操作数的排布格式。The instruction structure describes all information about instructions belonging to the same type: name of instruction type, opcode, operand array, number of operands, format description. Wherein, the opcode is an instruction opcode structure, the operand array is a collection of instruction operand structures, and the format description will describe the arrangement format of the operands.

指令编码通用结构描述和记录了指令的各个部分所使用在二进制编码中的域的位置以及域对应的具体机器编码。包括域开始位置数组,域长度数组,域分段数量和域值。The general structure of the instruction encoding describes and records the position of the fields used by each part of the instruction in the binary encoding and the specific machine encoding corresponding to the fields. Including the field start position array, field length array, field segment number and field value.

指令操作码结构用于描述指令操作码信息,包括:指令助记符名称列表,指令助记符编码列表,指令助记符名称列表长度,后缀列表,后缀类型个数。其中,指令助记符编码列表为指令编码的通用数据结构的集合,后缀列表为指令操作数结构的集合,用于描述后缀这种特殊的操作数。The instruction opcode structure is used to describe the instruction opcode information, including: instruction mnemonic name list, instruction mnemonic code list, instruction mnemonic name list length, suffix list, and number of suffix types. Among them, the instruction mnemonic encoding list is a collection of common data structures for instruction encoding, and the suffix list is a collection of instruction operand structures, which are used to describe special operands such as suffixes.

指令操作数结构描述包括寄存器操作数,立即数操作数,特殊操作数和寻址方式等操作数的信息,包括:操作数类型定义,操作数名称列表,操作数编码列表,复合操作数指针,重定位类型,相对跳转标志。其中,类型定义标明寄存器,立即数,后缀和符合操作数等类;操作数名称列表在操作数为后缀时,该项为罗列了某一类型的后缀的名称的集合,当操作数为立即数或寄存器时,该信息仅有一项,标示其为寄存器或者立即数;操作数编码列表为指令编码的通用数据结构的数组;重定位类型仅当操作数为立即数时有效,标识立即数的重定位类型;相对跳转标志在操作数为立即数时,标识立即数的值是于为相对于当前地址的偏移量。The instruction operand structure description includes register operand, immediate operand, special operand and addressing mode and other operand information, including: operand type definition, operand name list, operand encoding list, composite operand pointer, Relocation type, relative jump flag. Among them, the type definition indicates registers, immediate values, suffixes and corresponding operands; when the operand name list is a suffix, this item is a collection of names that list a certain type of suffix; when the operand is an immediate value or a register, the information has only one item, indicating that it is a register or an immediate value; the operand encoding list is an array of general data structures encoded by instructions; the relocation type is only valid when the operand is an immediate value, and identifies the immediate value Positioning type; relative jump flag When the operand is an immediate value, the value of the immediate value is the offset relative to the current address.

结构化信息自动配置模块将含有结构化的ISA信息的基本结构逐一传送给ISA信息管理模块,由该模块的ISA定义子模块跟据由结构化信息自动配置模块传输来的ISA代码信息的大小和结构,动态申请内存以存放这些代码信息,并根据前述的本发明定义的通用的ISA结构方法中的ISA定义方法实现对ISA的定义。The structured information automatic configuration module transmits the basic structure containing structured ISA information to the ISA information management module one by one, and the ISA definition sub-module of this module follows the size and size of the ISA code information transmitted by the structured information automatic configuration module. structure, dynamically apply for memory to store these code information, and realize the definition of ISA according to the ISA definition method in the general ISA structure method defined in the present invention.

如图4所示,ISA定义方法为通用的可扩展ISA的结构方法中基于基本结构的指令定义的方法。将含有ISA相关信息的基本结构组织成结构化的定义。在该方法中,每一个ISA指令类型都将对应一个指令结构,用于描述该类型指令的所有信息。该类型指令的指令结构中的操作码属性为一个操作码结构,该操作码结构的指令助记符名称列表记录了属于该指令类型的所有指令助记符名称,指令助记符编码列表按照指令助记符名称列表中助记符的顺序记录了指令助记符的编码信息,后缀列表属性对应了一组指令操作数结构用来记录该指令类型所使用的后缀信息。指令结构的操作数属性对应了一组指令操作数结构用来记录该指令类型所使用的操作数信息。所用的二进制编码信息(包括指令助记符,后缀,操作数),都保存在指令编码通用结构中。As shown in FIG. 4, the ISA definition method is a method defined based on basic structure instructions in the structure method of the general extensible ISA. Organize basic structures containing ISA-related information into structured definitions. In this method, each ISA instruction type will correspond to an instruction structure, which is used to describe all information of this type of instruction. The opcode attribute in the instruction structure of this type of instruction is an opcode structure. The instruction mnemonic name list of this opcode structure records all the instruction mnemonic names belonging to this instruction type. The instruction mnemonic code list follows the instruction The sequence of mnemonics in the mnemonic name list records the encoding information of the instruction mnemonics, and the suffix list attribute corresponds to a set of instruction operand structures used to record the suffix information used by the instruction type. The operand attribute of the instruction structure corresponds to a group of instruction operand structures used to record the operand information used by the instruction type. The used binary encoding information (including instruction mnemonics, suffixes, and operands) is stored in the instruction encoding general structure.

汇编功能处理模块从汇编源文件中读入读取汇编指令,并通知ISA信息库管理模块,ISA信息库管理模块的指令集体系搜索子模块从内存中的ISA定义中提取需要的信息,按照前述的通用的ISA结构方法中的ISA解析的方法将汇编指令解析出来,并完成二进制指令代码的编码,最后输出二进制指令代码文件。The assembly function processing module reads and reads assembly instructions from the assembly source file, and notifies the ISA information base management module, the instruction set system search sub-module of the ISA information base management module extracts the required information from the ISA definition in the memory, according to the aforementioned The ISA parsing method in the general ISA structure method parses the assembly instruction, completes the encoding of the binary instruction code, and finally outputs the binary instruction code file.

如图5所示,对汇编指令进行解析所采用的方法,为通用的可扩展ISA的结构方法中基于基本结构和指令定义的指令解析的方法。在该方法中,对于每一条汇编指令,词法分析其操作码(包含指令助记符和后缀),操作数,并将分析得到的信息填充入基于基本结构的指令解析结构中去。该结构使用一个指令结构,将该汇编指令的操作码信息填充入指令结构的操作码属性所对应的操作码结构中去,同时将该汇编指令的操作数信息填充入指令结构的操作数属性所对应的一组操作数结构中去。根据指令助记符和操作数找到与该指令相符合的指令类型,根据指令类型查找符合该指令类型的指令定义表并确定操作码操作数的具体编码定义(以通用编码结构存放),填充入指令解析结构中去。依次扫描数据域编码中的通用编码结构完成最后的指令编码。As shown in FIG. 5 , the method adopted for parsing assembly instructions is a method for parsing instructions based on the basic structure and instruction definition in the structure method of the general extensible ISA. In this method, for each assembly instruction, its operation code (including instruction mnemonic and suffix) and operands are lexically analyzed, and the information obtained from the analysis is filled into the instruction analysis structure based on the basic structure. This structure uses an instruction structure, fills the opcode information of the assembly instruction into the opcode structure corresponding to the opcode attribute of the instruction structure, and at the same time fills the operand information of the assembly instruction into the operand attribute of the instruction structure Go to the corresponding set of operand structures. Find the instruction type that matches the instruction according to the instruction mnemonic and the operand, look up the instruction definition table that matches the instruction type according to the instruction type, and determine the specific encoding definition of the opcode operand (stored in a general encoding structure), fill in Instruction parsing structure to go. The general coding structure in the data field coding is scanned sequentially to complete the final instruction coding.

生成源文件的二进制指令代码文件后,ARM指令集的汇编功能就此完成。After the binary instruction code file of the source file is generated, the assembly function of the ARM instruction set is completed.

若要重新生成新的ISA的汇编器,用户只需要将新的ISA信息填写成相应的规范化的表格,交给ISA描述模块,重复上述过程即可完成相应的汇编功能。从而无需重新编译而生成相应的汇编器。To regenerate a new ISA assembler, the user only needs to fill in the new ISA information into a corresponding standardized form, hand it to the ISA description module, and repeat the above process to complete the corresponding assembly function. Thus, the corresponding assembler is generated without recompilation.

有上可以看出,本发明提出了一种基于用户对指令集体系结构进行描述,从而得到相应汇编功能的汇编器。它使用一种面向用户的高度抽象的通用指令集体系结构的描述方法,这种方法简单,易行,并且直观,无需掌握复杂的描述语言,就可以方便的生成所需的汇编器。它还采用一种高度通用的可扩展的,能够提供良好的接口以满足指令的扩展需求,同时有利于高效的汇编器指令解析和编码的指令集体系数据结构,使得本发明最大限度的支持现有的指令集体系结构的需求和设计思想,满足各种指令集体系结构的汇编器的开发需要。同时,本发明还支持一种免编译的汇编器的生成方法,使得汇编器程序在编译结束之后的运行过程中,就可以接收由用户描述指令集体系结构而得到的信息,完成汇编器的功能,从而省去了每生成一个汇编器就要重新编译一次的麻烦。It can be seen from the above that the present invention proposes an assembler based on the user's description of the instruction set architecture to obtain the corresponding assembly function. It uses a highly abstract user-oriented general instruction set architecture description method, which is simple, easy to implement, and intuitive, and can easily generate the required assembler without mastering a complex description language. It also adopts a highly versatile and extensible instruction set architecture data structure that can provide a good interface to meet the expansion requirements of instructions, and is conducive to efficient assembler instruction parsing and encoding, so that the present invention can support the present invention to the greatest extent. The requirements and design ideas of some instruction set architectures meet the development needs of assemblers of various instruction set architectures. At the same time, the present invention also supports a method for generating an assembler without compiling, so that the assembler program can receive the information obtained by the user describing the instruction set architecture during the running process after the compilation, and complete the function of the assembler , thus saving the trouble of recompiling every time an assembler is generated.

Claims (10)

1.一种基于用户描述的汇编器,包括:ISA描述模块、结构化信息自动配置模块、ISA信息库管理模块以及汇编功能处理模块,其特征在于:1. a kind of assembler based on user description, comprising: ISA description module, structured information automatic configuration module, ISA information base management module and assembly function processing module, it is characterized in that: 所述ISA描述模块读入用户描述的指令集体系结构信息,并从用户的描述信息中提取出指令集体系结构数据至结构化信息自动配置模块,用户只需要将指令集体系结构信息按照规范填入规范化的表格就能完成对指令集体系结构的描述;The ISA description module reads in the instruction set architecture information described by the user, and extracts the instruction set architecture data from the user's description information to the structured information automatic configuration module. The user only needs to fill in the instruction set architecture information according to the specification. The description of the instruction set architecture can be completed by entering the standardized table; 所述结构化信息自动配置模块将数据组织成结构化的指令集体系结构信息并输出至ISA信息库管理模块;The structured information automatic configuration module organizes data into structured instruction set architecture information and outputs it to the ISA information base management module; 所述ISA信息库管理模块将该结构化的指令结构信息存放入内存中以完成指令集体系结构的定义,并将汇编过程中需要的ISA信息传递给汇编功能处理模块;The ISA information library management module stores the structured instruction structure information into the memory to complete the definition of the instruction set architecture, and passes the ISA information required in the assembly process to the assembly function processing module; 所述汇编功能模块读入汇编源文件,并从ISA信息库管理模块得到需要的指令集体系结构信息,用于对汇编源文件的处理,最后生成相应的二进制代码文件。The assembly function module reads in the assembly source file, and obtains the required instruction set architecture information from the ISA information base management module for processing the assembly source file, and finally generates a corresponding binary code file. 2.根据权利要求1所述的基于用户描述的汇编器,其特征是,所述的ISA描述模块使用的信息包括:指令类型表、助记符编码表、后缀编码表、操作数编码表、一般目的寄存器编码表和特殊目的寄存器表,其中:2. The assembler based on user description according to claim 1, wherein the information used by the ISA description module includes: instruction type table, mnemonic code table, suffix code table, operand code table, General-purpose register encoding table and special-purpose register table, where: 所述的指令类型表用于描述指令集体系结构的不同指令类型的信息;The instruction type table is used to describe information of different instruction types of the instruction set architecture; 所述的助记符编码表用于描述属于某一指令类型的指令助记符的二进制编码信息;The mnemonic encoding table is used to describe the binary encoding information of the instruction mnemonics belonging to a certain instruction type; 所述的后缀编码表用于描述属于某一指令类型的指令所使用的后缀的二进制编码信息;The suffix encoding table is used to describe the binary encoding information of the suffix used by the instruction belonging to a certain instruction type; 所述的操作数编码表用于描述属于某一指令类型的指令所使用的操作数的二进制编码信息;The operand encoding table is used to describe binary encoding information of operands used by instructions belonging to a certain instruction type; 所述的一般目的寄存器表用于描述该指令集体系结构使用的一般目的寄存器的信息;The general-purpose register table is used to describe the information of the general-purpose registers used by the instruction set architecture; 所述的特殊目的寄存器表用于描述该指令集体系结构使用的特殊目的寄存器的信息。The special purpose register table is used to describe the information of special purpose registers used by the instruction set architecture. 3.根据权利要求1所述的基于用户描述的汇编器,其特征是,所述的结构化信息自动配置模块,其输出的结构化的ISA代码信息,将含有指令集体系结构相关信息的基本结构组织成结构化的定义,每一个指令集体系结构指令类型都将对应一个指令结构,用于描述该类型指令的所有信息,该类型指令的指令结构中的操作码属性为一个操作码结构,该操作码结构的指令助记符名称列表记录了属于该指令类型的所有指令助记符名称,指令助记符编码列表按照指令助记符名称列表中助记符的顺序记录了指令助记符的编码信息,后缀列表属性对应了一组指令操作数结构用来记录该指令类型所使用的后缀信息,指令结构的操作数属性对应了一组指令操作数结构用来记录该指令类型所使用的操作数信息,所用的二进制编码信息都保存在指令编码通用结构中。3. The assembler based on user description according to claim 1, characterized in that, the structured information of the structured information automatic configuration module, the output of the structured ISA code information, will contain the basic information of the relevant information of the instruction set architecture The structure is organized into a structured definition. Each instruction set architecture instruction type will correspond to an instruction structure, which is used to describe all information of this type of instruction. The opcode attribute in the instruction structure of this type of instruction is an opcode structure. The instruction mnemonic name list of the opcode structure records all instruction mnemonic names belonging to the instruction type, and the instruction mnemonic encoding list records the instruction mnemonics in the order of mnemonics in the instruction mnemonic name list The suffix list attribute corresponds to a set of instruction operand structures used to record the suffix information used by the instruction type, and the operand attribute of the instruction structure corresponds to a set of instruction operand structures used to record the suffix information used by the instruction type. The operand information and the binary encoding information used are all stored in the instruction encoding general structure. 4.根据权利要求1所述的基于用户描述的汇编器,其特征是,所述的ISA信息库管理模块包括ISA定义子模块和指令集体系搜索子模块,所述的ISA定义子模块跟据由结构化信息自动配置模块传输来的指令集体系结构代码信息的大小和结构,动态申请内存以存放这些代码信息,采用基于基本结构的指令定义的方法实现对指令集体系结构的定义;所述的指令集体系搜索子模块按照汇编功能处理模块的需要搜索内存中定义的指令集体系结构,并将需要的信息输出给汇编功能处理模块。4. The assembler based on user description according to claim 1, characterized in that, said ISA information base management module includes an ISA definition submodule and an instruction set system search submodule, and said ISA definition submodule follows The size and structure of the instruction set architecture code information transmitted by the structured information automatic configuration module, dynamically apply for memory to store these code information, and implement the definition of the instruction set architecture by using the method of instruction definition based on the basic structure; The instruction set architecture search submodule searches the instruction set architecture defined in the memory according to the needs of the assembly function processing module, and outputs the required information to the assembly function processing module. 5.根据权利要求1所述的基于用户描述的汇编器,其特征是,所述的汇编功能处理模块不包含指令集体系结构的相关信息,在其执行汇编过程中,指令集体系结构的相关信息通过向ISA信息库管理模块获得,该模块从汇编源文件中读入读取汇编指令,并通知ISA信息库管理模块搜索内存中的指令集体系结构的定义,从中提取需要的信息,采用结构化的ISA信息结构中的基于基本结构和指令定义的指令解析的方法将汇编指令解析出来,并完成二进制指令代码的编码,最后输出二进制指令代码文件。5. The assembler based on user description according to claim 1, characterized in that, the assembly function processing module does not contain the relevant information of the instruction set architecture, and during its execution of the assembly process, the relevant information of the instruction set architecture The information is obtained from the ISA information base management module, which reads and reads assembly instructions from the assembly source file, and notifies the ISA information base management module to search for the definition of the instruction set architecture in the memory, extract the required information from it, and adopt the structure The instruction parsing method based on the basic structure and instruction definition in the standardized ISA information structure parses the assembly instruction, completes the coding of the binary instruction code, and finally outputs the binary instruction code file. 6.一种基于用户描述的汇编器的实现方法,其特征在于,包括以下步骤:6. A method for implementing an assembler based on user description, comprising the following steps: 第一步,编译所述的基于用户描述的汇编器的源程序;The first step is to compile the source program based on the assembler described by the user; 第二步,用户使用对指令集体系结构的描述方法对指令集体系结构进行描述,用户只需要将指令集体系结构信息按照规范填入规范化的表格就能完成对ISA的描述;In the second step, the user uses the instruction set architecture description method to describe the instruction set architecture. The user only needs to fill in the instruction set architecture information into the standardized form according to the specification to complete the description of the ISA; 第三步,将用户对指令集体系结构的描述中的相关数据提取出来;The third step is to extract the relevant data in the user's description of the instruction set architecture; 第四步,将提取出来的指令集体系结构相关数据组织成一种结构化的ISA信息结构,所述的结构化的ISA信息结构包括:一组用于指令定义和指令解析的基本结构,基于上述基本结构的指令定义的方法,和基于上述基本结构和指令定义的指令解析的方法,在第四步中,数据将被组织成上述基本结构;The fourth step is to organize the extracted instruction set architecture-related data into a structured ISA information structure. The structured ISA information structure includes: a set of basic structures for instruction definition and instruction analysis, based on the above The method of instruction definition of the basic structure, and the method of instruction analysis based on the above basic structure and instruction definition, in the fourth step, the data will be organized into the above basic structure; 第五步,将组织后的指令集体系结构信息,按照其大小和结构,动态的存放入内存中,采用步骤四中所述的基于基本结构的指令定义的方法完成对指令集体系结构的定义;The fifth step is to dynamically store the organized instruction set architecture information in the memory according to its size and structure, and use the method of instruction definition based on the basic structure described in step four to complete the definition of the instruction set architecture ; 第六步,读取汇编源代码并对每条汇编指令做逐一的汇编处理,从汇编指令中获取相关的指令集体系结构线索信息;The sixth step is to read the assembly source code and assemble each assembly instruction one by one, and obtain the relevant instruction set architecture clue information from the assembly instruction; 第七步,根据线索信息从内存中的指令集体系结构定义中提取需要的指令集体系结构信息;The seventh step is to extract the required instruction set architecture information from the instruction set architecture definition in the memory according to the clue information; 第八步,根据指令集体系结构信息,采用步骤四中所述的基于基本结构和指令定义的指令解析的方法完成对汇编指令的解析并最终完成对二进制指令的编码;In the eighth step, according to the instruction set architecture information, the method of instruction analysis based on the basic structure and instruction definition described in step 4 is used to complete the analysis of the assembly instructions and finally complete the encoding of the binary instructions; 第九步,完成汇编源代码中所有的汇编指令的处理,输出二进制代码文件;The ninth step is to complete the processing of all assembly instructions in the assembly source code, and output the binary code file; 第十步,若要重新生成新的指令集体系结构的汇编器,转至第二步重新开始,即完成相应的汇编功能,无需重新编译。In the tenth step, if you want to regenerate the assembler of the new instruction set architecture, go to the second step and start again, that is, complete the corresponding assembly function without recompiling. 7.根据权利要求6所述的基于用户描述的汇编器的实现方法,其特征是,第二步所述的对指令集体系结构的描述方法,具体使用的规范化的表格包括:指令类型表、助记符编码表、后缀编码表、操作数编码表、一般目的寄存器编码表和特殊目的寄存器表,其中:7. The method for implementing an assembler based on user description according to claim 6, characterized in that, in the description method of the instruction set architecture described in the second step, the specifically used standardized tables include: instruction type table, Mnemonic code table, suffix code table, operand code table, general purpose register code table, and special purpose register table, where: 所述的指令类型表用于描述指令集体系结构的不同指令类型的信息;The instruction type table is used to describe information of different instruction types of the instruction set architecture; 所述的助记符编码表用于描述属于某一指令类型的指令助记符的二进制编码信息;The mnemonic encoding table is used to describe the binary encoding information of the instruction mnemonics belonging to a certain instruction type; 所述的后缀编码表用于描述属于某一指令类型的指令所使用的后缀的二进制编码信息;The suffix encoding table is used to describe the binary encoding information of the suffix used by the instruction belonging to a certain instruction type; 所述的操作数编码表用于描述属于某一指令类型的指令所使用的操作数的二进制编码信息;The operand encoding table is used to describe binary encoding information of operands used by instructions belonging to a certain instruction type; 所述的一般目的寄存器表用于描述该指令集体系结构使用的一般目的寄存器的信息;The general-purpose register table is used to describe the information of the general-purpose registers used by the instruction set architecture; 所述的特殊目的寄存器表用于描述该指令集体系结构使用的特殊目的寄存器的信息。The special purpose register table is used to describe the information of special purpose registers used by the instruction set architecture. 8.根据权利要求6或7所述的基于用户描述的汇编器的实现方法,其特征是,所述的对指令集体系结构的描述方法,是指:一套指令集体系结构描述只有一个指令类型表、一个一般目的寄存器表、一个特殊目的寄存器表,指令类型表中的每一个指令类型将对应一个助记符编码表,一个后缀编码表,一个操作数编码表,用来描述该类型的指令的操作码和操作数的信息;8. The method for implementing an assembler based on user description according to claim 6 or 7, wherein the described method for describing the instruction set architecture refers to: a set of instruction set architecture description has only one instruction Type table, a general-purpose register table, and a special-purpose register table. Each instruction type in the instruction type table will correspond to a mnemonic code table, a suffix code table, and an operand code table, which are used to describe the type. Information about the instruction's opcode and operands; 所述的指令类型表包括:指令类型的名称、该类型指令所带的操作数的数量、能使用的后缀数目、指令类型的标识、操作数的类型、该指令类型使用的前缀六个属性;The instruction type table includes: the name of the instruction type, the number of operands carried by this type of instruction, the number of suffixes that can be used, the identifier of the instruction type, the type of the operand, and the six attributes of the prefix used by the instruction type; 所述的助记符编码表包括:助记符名称、每段助记符编码起始位置、每段的编码的长度、助记符编码被分割的段数、助记符的编码五个属性;The mnemonic encoding table includes: mnemonic name, starting position of each segment of mnemonic encoding, length of encoding of each segment, number of segmented segments of mnemonic encoding, and five attributes of mnemonic encoding; 所述的后缀编码表包括:后缀名称、每段后缀编码起始位置、每段的编码的长度、后缀编码被分割的段数、后缀的编码、该后缀所属的类型六个属性;The suffix coding table includes: suffix name, starting position of each segment of suffix coding, length of coding of each segment, number of segmented segments of the suffix coding, coding of the suffix, and six attributes of the type to which the suffix belongs; 所述的操作数编码表包括:操作数的类型名称、每段操作数编码起始位置、每段的编码的长度、助记符编码被分割的段数、操作数的编码、立即数的值是否为相对于当前指令的偏移量标识、立即数的重定位的类型、立即数的特殊处理方式八个属性,其中立即数的值是否为相对于当前指令的偏移量标识,立即数的重定位的类型,立即数的特殊处理方式都和立即数的重定位有关,当操作数为寄存器时,这三项无效;The operand encoding table includes: the type name of the operand, the starting position of each segment of the operand encoding, the length of each segment of the encoding, the number of segmented segments of the mnemonic encoding, the encoding of the operand, and whether the value of the immediate value is These are the eight attributes of the offset identifier relative to the current instruction, the relocation type of the immediate value, and the special processing mode of the immediate value. Among them, whether the value of the immediate value is an offset identifier relative to the current instruction, the relocation of the immediate value The type of positioning and the special handling of immediate data are related to the relocation of immediate data. When the operand is a register, these three items are invalid; 所述的一般目的寄存器表包括:寄存器的标识名、寄存器的起始编号、寄存器的终止编号、寄存器别名对应关系描述四个属性构成;The general-purpose register table includes: the identification name of the register, the start number of the register, the end number of the register, and the corresponding relationship description of the register alias to form four attributes; 所述的特殊目的寄存器表包括:特殊目的寄存器的名称、每段特殊目的寄存器编码起始位置、每段的编码的长度、特殊目的寄存器编码被分割的段数、特殊目的寄存器的编码五个属性构成。The special-purpose register table includes: the name of the special-purpose register, the starting position of each special-purpose register code, the length of each code, the number of segments that the special-purpose register code is divided into, and five attributes of the special-purpose register code . 9.根据权利要求6所述的基于用户描述的汇编器的实现方法,其特征是,所述的用于指令定义和指令解析的基本结构,包括:指令结构、指令编码的通用结构、指令操作码结构和指令操作数结构,9. The method for implementing an assembler based on user description according to claim 6, wherein the basic structure used for instruction definition and instruction analysis includes: instruction structure, general structure of instruction encoding, instruction operation code structure and instruction operand structure, 所述的指令结构描述了属于同样类型的指令的全部信息,它包括:指令类型、操作码、操作数组、操作数数量、格式描述五个基本属性,其中:操作码属性为指令操作码结构,操作数组属性为指令操作数结构的数组;The instruction structure describes all information of instructions belonging to the same type, and it includes five basic attributes: instruction type, opcode, operand array, number of operands, and format description, wherein: the opcode attribute is the instruction opcode structure, The operation array attribute is an array of instruction operand structures; 所述的指令编码通用结构描述和记录了域的位置以及域对应的具体机器编码,它包含了四个属性:域开始位置数组、域长度数组、域分段数量和域值;The general structure of the instruction encoding describes and records the position of the domain and the specific machine code corresponding to the domain, and it includes four attributes: an array of domain start positions, an array of domain lengths, the number of domain segments and domain values; 所述的指令操作码结构用于描述指令操作码信息,其属性包括:前缀名称、指令助记符名称列表、指令助记符编码列表、指令助记符名称列表长度、后缀列表、后缀类型个数,其中:指令助记符编码列表为指令编码的通用数据结构的数组,后缀列表为指令操作数结构的数组,用于描述后缀这种特殊的操作数;The instruction opcode structure is used to describe the instruction opcode information, and its attributes include: prefix name, instruction mnemonic name list, instruction mnemonic code list, instruction mnemonic name list length, suffix list, suffix type number number, where: the instruction mnemonic code list is an array of general data structures encoded by instructions, and the suffix list is an array of instruction operand structures, which are used to describe special operands such as suffixes; 所述的指令操作数结构描述包括寄存器操作数、立即数操作数、特殊操作数和寻址方式操作数的信息,其属性包括:类型定义、操作数名称列表、操作数编码列表、复合操作数指针、重定位类型、相对跳转标志,其中:操作数编码列表为指令编码的通用数据结构的数组;The instruction operand structure description includes information about register operands, immediate operands, special operands and addressing mode operands, and its attributes include: type definition, operand name list, operand encoding list, composite operand pointer, relocation type, and relative jump flag, wherein: the operand encoding list is an array of general data structures for instruction encoding; 所述的基于基本结构的指令定义的方法,是指:将含有指令集体系结构相关信息的基本结构组织成结构化的定义,每一个指令集体系结构指令类型都将对应一个指令结构,用于描述该类型指令的所有信息,该类型指令的指令结构中的操作码属性为一个操作码结构,该操作码结构的指令助记符名称列表记录了属于该指令类型的所有指令助记符名称,指令助记符编码列表按照指令助记符名称列表中助记符的顺序记录了指令助记符的编码信息,后缀列表属性对应了一组指令操作数结构用来记录该指令类型所使用的后缀信息,指令结构的操作数属性对应了一组指令操作数结构用来记录该指令类型所使用的操作数信息,所用的二进制编码信息都保存在指令编码通用结构中;The method of instruction definition based on the basic structure refers to: organize the basic structure containing the relevant information of the instruction set architecture into a structured definition, and each instruction type of the instruction set architecture will correspond to an instruction structure, which is used for Describe all the information of this type of instruction. The opcode attribute in the instruction structure of this type of instruction is an opcode structure. The instruction mnemonic name list of this opcode structure records all the instruction mnemonic names belonging to this instruction type. The instruction mnemonic encoding list records the encoding information of the instruction mnemonics in the order of the mnemonics in the instruction mnemonic name list, and the suffix list attribute corresponds to a set of instruction operand structures used to record the suffix used by the instruction type Information, the operand attribute of the instruction structure corresponds to a set of instruction operand structures used to record the operand information used by the instruction type, and the binary encoding information used is stored in the instruction encoding general structure; 所述的基于基本结构和指令定义的指令解析的方法,是指:对于每一条汇编指令,词法分析其操作码、操作数,并将分析得到的信息填充入基于基本结构的指令解析结构中去,该结构使用一个指令结构,将该汇编指令的操作码信息填充入指令结构的操作码属性所对应的操作码结构中去,同时将该汇编指令的操作数信息填充入指令结构的操作数属性所对应的一组操作数结构中去,根据指令助记符和操作数找到与该指令相符合的指令类型,根据指令类型查找符合该指令类型的指令定义表并确定操作码操作数的具体编码定义,填充入指令解析结构中去,依次扫描数据域编码中的通用编码结构完成最后的指令编码。The described instruction analysis method based on the basic structure and instruction definition refers to: for each assembly instruction, its opcode and operand are analyzed lexically, and the information obtained by the analysis is filled into the instruction analysis structure based on the basic structure. , the structure uses an instruction structure, fills the opcode information of the assembly instruction into the opcode structure corresponding to the opcode attribute of the instruction structure, and at the same time fills the operand information of the assembly instruction into the operand attribute of the instruction structure Go to the corresponding set of operand structures, find the instruction type that matches the instruction according to the instruction mnemonic and the operand, look up the instruction definition table that matches the instruction type according to the instruction type, and determine the specific encoding of the opcode operand Define, fill in the instruction parsing structure, and scan the general encoding structure in the data field encoding in turn to complete the final instruction encoding. 10.根据权利要求6所述的基于用户描述的汇编器的实现方法,其特征是,所述的重新生成新的指令集体系结构的汇编器,其方法为:基于用户描述的指令集体系结构信息存放在内存中,从而在生成新的汇编功能的汇编器时,只要把用户描述的相应的指令集体系结构指令信息结构化存放入内存供汇编过程使用,即完成相应的汇编功能,而无需通过重新编译的方法生成汇编器。10. The method for implementing an assembler based on user description according to claim 6, wherein the method for regenerating the assembler of a new instruction set architecture is: based on the instruction set architecture described by a user The information is stored in the memory, so that when generating a new assembly function assembler, as long as the corresponding instruction set architecture instruction information described by the user is structured and stored in the memory for use in the assembly process, the corresponding assembly function is completed without requiring Generate assembler by recompilation method.
CNB2007100458880A 2007-09-13 2007-09-13 Assembler Based on User Description and Its Realization Method Expired - Fee Related CN100541433C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007100458880A CN100541433C (en) 2007-09-13 2007-09-13 Assembler Based on User Description and Its Realization Method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007100458880A CN100541433C (en) 2007-09-13 2007-09-13 Assembler Based on User Description and Its Realization Method

Publications (2)

Publication Number Publication Date
CN101118498A true CN101118498A (en) 2008-02-06
CN100541433C CN100541433C (en) 2009-09-16

Family

ID=39054629

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007100458880A Expired - Fee Related CN100541433C (en) 2007-09-13 2007-09-13 Assembler Based on User Description and Its Realization Method

Country Status (1)

Country Link
CN (1) CN100541433C (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876916A (en) * 2010-06-13 2010-11-03 北京红旗胜利科技发展有限责任公司 Development method and device for assembly language program
CN102681821A (en) * 2011-12-31 2012-09-19 浙江大学 Binary tool set designing method based on C-SKY v2 instruction set
CN103218246A (en) * 2013-04-19 2013-07-24 中国科学院自动化研究所 Binary tool generating method based on graph description language
CN110488738A (en) * 2019-07-23 2019-11-22 中车青岛四方机车车辆股份有限公司 A kind of code generating method and device
CN111240682A (en) * 2018-11-28 2020-06-05 深圳市中兴微电子技术有限公司 Method and device, device, and storage medium for processing instruction data
CN112148370A (en) * 2020-09-21 2020-12-29 深圳前海微众银行股份有限公司 Machine code generation method, apparatus, device, and computer-readable storage medium
CN112486906A (en) * 2020-12-18 2021-03-12 清华大学 Formatted reconfigurable processor assembly instruction processing method and device
CN112528292A (en) * 2020-12-17 2021-03-19 深圳爱加密科技有限公司 BAP-based vulnerability detection method and intelligent terminal
WO2022000371A1 (en) * 2020-07-01 2022-01-06 深圳市大疆创新科技有限公司 Interface generation method and device, and computer-readable storage medium
CN114895917A (en) * 2022-05-17 2022-08-12 中国人民解放军国防科技大学 Compiling method for converting extensible assembly instruction into binary instruction
CN117519665A (en) * 2023-09-28 2024-02-06 中国人民解放军国防科技大学 A model-driven assembler automatic generation method and device

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876916B (en) * 2010-06-13 2014-02-05 北京红旗胜利科技发展有限责任公司 Development method and device for assembly language program
CN101876916A (en) * 2010-06-13 2010-11-03 北京红旗胜利科技发展有限责任公司 Development method and device for assembly language program
CN102681821A (en) * 2011-12-31 2012-09-19 浙江大学 Binary tool set designing method based on C-SKY v2 instruction set
CN102681821B (en) * 2011-12-31 2014-07-30 浙江大学 Binary tool set designing method based on C-SKY v2 instruction set
CN103218246A (en) * 2013-04-19 2013-07-24 中国科学院自动化研究所 Binary tool generating method based on graph description language
CN111240682A (en) * 2018-11-28 2020-06-05 深圳市中兴微电子技术有限公司 Method and device, device, and storage medium for processing instruction data
CN110488738A (en) * 2019-07-23 2019-11-22 中车青岛四方机车车辆股份有限公司 A kind of code generating method and device
WO2022000371A1 (en) * 2020-07-01 2022-01-06 深圳市大疆创新科技有限公司 Interface generation method and device, and computer-readable storage medium
CN112148370A (en) * 2020-09-21 2020-12-29 深圳前海微众银行股份有限公司 Machine code generation method, apparatus, device, and computer-readable storage medium
CN112528292A (en) * 2020-12-17 2021-03-19 深圳爱加密科技有限公司 BAP-based vulnerability detection method and intelligent terminal
CN112486906A (en) * 2020-12-18 2021-03-12 清华大学 Formatted reconfigurable processor assembly instruction processing method and device
CN112486906B (en) * 2020-12-18 2024-06-11 清华大学 Formatted reconfigurable processor assembly instruction processing method and device
CN114895917A (en) * 2022-05-17 2022-08-12 中国人民解放军国防科技大学 Compiling method for converting extensible assembly instruction into binary instruction
CN114895917B (en) * 2022-05-17 2024-12-31 中国人民解放军国防科技大学 A compiling method for converting scalable assembly instructions into binary instructions
CN117519665A (en) * 2023-09-28 2024-02-06 中国人民解放军国防科技大学 A model-driven assembler automatic generation method and device
CN117519665B (en) * 2023-09-28 2024-05-31 中国人民解放军国防科技大学 Model-driven assembler automatic generation method and device

Also Published As

Publication number Publication date
CN100541433C (en) 2009-09-16

Similar Documents

Publication Publication Date Title
CN100541433C (en) Assembler Based on User Description and Its Realization Method
CN107861728B (en) Method and system for converting traditional program language into modern program language
Marwedel et al. Code generation for embedded processors
Alfred et al. Compilers principles, techniques & tools
US7313773B1 (en) Method and device for simulator generation based on semantic to behavioral translation
US8276130B2 (en) Method and compiler of compiling a program
EP2770429B1 (en) Method and device for generating simulator
CN103235724A (en) Atomic operation semantic description based integrated translation method for multisource binary codes
Gyllenhaal A machine description language for compilation
CN100487652C (en) Automaton method for script language
US20080033968A1 (en) Methods and apparatus for input specialization
CN102520963B (en) Method and system for implementing business logic processing based on strongly typed relational mapping
Ravipati et al. Toward the deconstruction of Dyninst
US20040010780A1 (en) Method and apparatus for approximate generation of source code cross-reference information
CN117193782B (en) Grammar mapping method and device from SIMSCRIPT language to C language
CN113448553A (en) C language project dependency information management and visualization method and system
CN117668785A (en) Virtual instruction extraction method and system based on symbolic execution
CN114791811B (en) A method for implementing an assembler based on metafunction templates
CN116775599A (en) Data migration method, device, electronic equipment and storage medium
CN115390936A (en) Unified verification method, device, equipment and storage medium
Quesada A model-driven parser generator with reference resolution support
Kornerup et al. Interpretation and code generation based on intermediate languages
WO2008075087A1 (en) Code translator and method of automatically translating modelling language code to hardware language code
CN111552465A (en) A traceability method from P2020 machine code program to C language source program
CN111209757A (en) Method and device for realizing multi-language version of relay protection device based on language package

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090916

Termination date: 20170913