JP2875711B2 - Program conversion device and processor - Google Patents

Program conversion device and processor

Info

Publication number
JP2875711B2
JP2875711B2 JP12621293A JP12621293A JP2875711B2 JP 2875711 B2 JP2875711 B2 JP 2875711B2 JP 12621293 A JP12621293 A JP 12621293A JP 12621293 A JP12621293 A JP 12621293A JP 2875711 B2 JP2875711 B2 JP 2875711B2
Authority
JP
Japan
Prior art keywords
instruction
address
register
data
bit width
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.)
Expired - Lifetime
Application number
JP12621293A
Other languages
Japanese (ja)
Other versions
JPH06337791A (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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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
Priority to JP12621293A priority Critical patent/JP2875711B2/en
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to DE69432445T priority patent/DE69432445T2/en
Priority to DE69434971T priority patent/DE69434971T2/en
Priority to EP02076028A priority patent/EP1229440B1/en
Priority to EP94303862A priority patent/EP0626641B1/en
Priority to EP02076025A priority patent/EP1229439A3/en
Priority to DE69434967T priority patent/DE69434967T2/en
Priority to EP01202455A priority patent/EP1164479B1/en
Priority to EP04075265A priority patent/EP1416374A3/en
Publication of JPH06337791A publication Critical patent/JPH06337791A/en
Priority to US08/587,338 priority patent/US5809306A/en
Application granted granted Critical
Publication of JP2875711B2 publication Critical patent/JP2875711B2/en
Priority to US09/662,484 priority patent/USRE41959E1/en
Priority to US10/991,367 priority patent/USRE40498E1/en
Priority to US11/607,889 priority patent/US20080320454A1/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は高級言語プログラムを機
械語プログラムに変換するプログラム変換装置、及び、
その機械語プログラムを実行するプロセッサに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program conversion device for converting a high-level language program into a machine language program, and
The present invention relates to a processor that executes the machine language program.

【0002】[0002]

【従来の技術】近年の電子技術の発展により、マイクロ
プロセッサ等の情報処理装置が普及し、あらゆる分野で
用いられている。。従来のプロセッサとしては、例え
ば、森下巖著、「マイクロプロセッサのハードウェア」
(1984年11月9日、岩波書店)に示されている、
セグメントアドレス方式の16ビットプロセッサがあ
る。
2. Description of the Related Art With the recent development of electronic technology, information processing devices such as microprocessors have become widespread and are used in all fields. . As a conventional processor, for example, Iwao Morishita, "Microprocessor hardware"
(November 9, 1984, Iwanami Shoten),
There is a 16-bit processor of the segment address system.

【0003】このセグメントアドレス方式の16ビット
プロセッサは、16ビットよりも上位のビットを含む上
位アドレスを格納するセグメントレジスタを備えること
により、データのビット幅が16ビットでありながら6
4キロバイトを超えるアドレス空間を扱うことができ
る。すなわち、64キロバイトを越える全アドレス空間
をセグメントと呼ぶ64キロバイト単位の部分に分ける
とともに、各セグメントに番号を付ける方式である。ア
ドレスは、セグメントレジスタに収められたセグメント
番号と、データのビット幅と同じ16ビットで表される
セグメントの先頭からの距離(オフセット)とで管理さ
れる。これにより、セグメントアドレス方式の16ビッ
トプロセッサでは、データのビット幅が16ビットで6
4キロバイトを超えるアドレス空間を扱うことができ
る。
The 16-bit processor of the segment address system has a segment register for storing an upper address including bits higher than 16 bits.
Address space greater than 4 kilobytes can be handled. That is, the entire address space exceeding 64 kilobytes is divided into 64 kilobyte units called segments, and a number is assigned to each segment. The address is managed by the segment number stored in the segment register and the distance (offset) from the head of the segment represented by 16 bits, which is the same as the data bit width. Thus, in the 16-bit processor of the segment address system, the data bit width is 16 bits and 6 bits.
Address space greater than 4 kilobytes can be handled.

【0004】また、従来のプロセッサとして、同書に示
されている32ビットプロセッサがある。この32ビッ
トプロセッサは、32ビット幅のアドレスを32ビット
幅のデータと同一に管理して、4ギガバイトのアドレス
空間を扱うことができる。このようなプロセッサ上で実
行される機械語プログラムは、コンパイラ等のプログラ
ム変換装置によって生成される。
Further, as a conventional processor, there is a 32-bit processor shown in the same book. This 32-bit processor manages a 32-bit address in the same way as 32-bit data, and can handle a 4-gigabyte address space. The machine language program executed on such a processor is generated by a program conversion device such as a compiler.

【0005】上記16ビットプロセッサに対するコンパ
イラは、アドレス管理の方式に関して、ラージモデル方
式を呼ばれるものと、ニアファーモデル方式と呼ばれる
ものがある。ラージモデル方式を採用するコンパイラ
は、ポインタ変数を常にセグメントレジスタと16ビッ
トオフセットとを対にして設定する。このため、このコ
ンパイラによるオブジェクトコードを実行するプロセッ
サは、アドレス計算の度にセグメントレジスタの内容を
計算して更新する操作が発生し、セグメントアドレス方
式を採らない16ビットプロセッサに比べて著しく性能
が劣化するという短所を有している。
[0005] Compilers for the 16-bit processor include a large model method and a near-far model method for address management. A compiler adopting the large model method always sets a pointer variable by pairing a segment register with a 16-bit offset. For this reason, the processor that executes the object code by this compiler requires the operation of calculating and updating the contents of the segment register every time the address is calculated, and the performance is significantly degraded as compared with a 16-bit processor that does not employ the segment address method. It has the disadvantage of doing so.

【0006】また、ニアファーモデル方式とを採用する
コンパイラは、ラージモデル方式における上記の短所を
次のようにして解決している。この方式は、同一セグメ
ント内をアクセスするためのニアポインタ変数と、セグ
メント境界をまたいでアクセスするためのファーポイン
タ変数という2種類のポインタ変数を指定できるように
なっている。コンパイラは、ニアポインタ変数には16
ビットオフセットのみを設定し、ファーポインタ変数に
はセグメントレジスタと16ビットオフセットとを対に
して設定する。ニアポインタ変数とファーポインタ変数
のいずれを用いるかは、プログラマが選択する。
A compiler adopting the near-far model method solves the above-mentioned disadvantages in the large model method as follows. In this method, two types of pointer variables can be designated: a near pointer variable for accessing the same segment and a far pointer variable for accessing over a segment boundary. The compiler uses 16 for near pointer variables.
Only the bit offset is set, and the far pointer variable is set by pairing the segment register and the 16-bit offset. The programmer selects whether to use the near pointer variable or the far pointer variable.

【0007】このニアファーモデル方式は、ニアポイン
タ変数を用いる場面ではラージモデル方式に比べて性能
が向上する反面、プログラマがプログラム作成時にセグ
メント境界を認識して2種類のポインタ変数を使い分け
る必要があり、プログラム開発効率が著しく低下すると
いう新たな問題点を有している。他方、32ビットプロ
セッサに対するコンパイラは、上記の問題点を有してい
ない。即ち、コンパイラが32ビットのデータ変数と同
様にポインタ変数にも32ビットのアドレスを設定する
ので、プログラマがセグメントの境界を認識する必要が
ないので、プログラムの開発効率を低下させることもな
い。また、コンパイルされたプロクラムを実行するプロ
セッサは、アドレス計算による性能劣化を発生させな
い。そして、4ギガバイトという広大なアドレス空間を
扱うことができる。
In the near-far model system, the performance is improved as compared with the large model system in the case of using the near pointer variable, but it is necessary for the programmer to recognize the segment boundary when creating a program and to use two types of pointer variables properly. However, there is a new problem that the program development efficiency is significantly reduced. On the other hand, compilers for 32-bit processors do not have the above problems. That is, since the compiler sets a 32-bit address for the pointer variable as well as the 32-bit data variable, there is no need for the programmer to recognize the segment boundaries, so that the program development efficiency is not reduced. Further, the processor that executes the compiled program does not cause performance degradation due to address calculation. And it can handle a huge address space of 4 gigabytes.

【0008】[0008]

【発明が解決しようとする課題】しかしながら従来技術
のプロセッサおよびプログラム変換装置によれば、組み
込み用途のマイクロコンピュータでの応用(アプリケー
ション)おいては、32ビットのデータ幅を必要とせ
ず、かつ、4ギガバイトのアドレス空間を必要としない
ものがほとんどである。多くのアプリケーションでは、
データ幅については16ビットあれば十分であるが、ア
ドレス空間については64キロバイトでは不足する。こ
のような現状に鑑みると、データのビット幅が16ビッ
ト必要で、かつ、アドレス空間が64キロバイト以上を
必要とするが4ギガバイトもの大きさを必要としない応
用では、最適なマイクロコンピュータおよびコンパイラ
がなかったという問題点があった。
However, according to the processor and the program conversion device of the prior art, a 32-bit data width is not required for an application using an embedded microcomputer, and the application is not required. Most do not require gigabytes of address space. In many applications,
A data width of 16 bits is sufficient, but an address space of 64 kilobytes is insufficient. In view of this situation, in applications where the data bit width is required to be 16 bits and the address space requires 64 KB or more but does not require a size as large as 4 gigabytes, an optimal microcomputer and compiler are required. There was a problem that there was no.

【0009】より具体的に説明すると、32ビットプロ
セッサは、32ビットのデータおよびアドレスを処理す
るためのハードウェアを有することから、過分なハード
ウェアとなるのでコストおよび消費電力が増大するとい
う問題点を有している。16ビットプロセッサは、アド
レス空間の管理が従来技術で述べたようにアドレス計算
の点で性能劣化を避けられない。また、プログラマがセ
グメントの境界を認識する必要があることから、プログ
ラムの開発効率が落ちる。
More specifically, since a 32-bit processor has hardware for processing 32-bit data and addresses, the hardware becomes excessive and the cost and power consumption increase. have. In the 16-bit processor, the management of the address space cannot avoid the performance deterioration in the address calculation as described in the related art. Further, since the programmer needs to recognize the segment boundaries, the development efficiency of the program is reduced.

【0010】また、32ビットプロセッサ用コンパイラ
は、16ビットまたは32ビットを基本語長とする機械
語命令を使い分け、プログラム中では32ビットのアド
レス指定が必要なために、プログラムのコードサイズが
増大する。また、32ビットプロセッサとメモリとを接
続するデータバスのビット幅が16ビットの場合は32
ビットに比べて性能が著しく劣化するという問題点も有
している。
A compiler for a 32-bit processor uses a machine instruction having a basic word length of 16 bits or 32 bits, and requires a 32-bit address designation in a program, thereby increasing the code size of the program. . When the bit width of the data bus connecting the 32-bit processor and the memory is 16 bits, 32 bits are used.
There is also a problem that the performance is significantly deteriorated as compared with the bit.

【0011】本発明は上記問題点に鑑み、データのビッ
ト幅が16ビットで16メガバイト程度のアドレス空間
を必要とする応用において、好適したプログラム変換装
置およびプロセッサを提供することを目的とする。
SUMMARY OF THE INVENTION The present invention has been made in consideration of the above problems, and has as its object to provide a program conversion device and a processor suitable for an application in which a data bit width is 16 bits and an address space of about 16 megabytes is required.

【0012】[0012]

【課題を解決するための手段】上記の課題を解決するた
め本発明のプログラム変換装置は、主たるデータの型に
おける有効なビット幅よりも長いビット幅をもつアドレ
スを扱うプロセッサを対象とし、高級言語プログラムに
基づいて機械語命令を生成するプログラム変換装置であ
って、利用者の設定に基づいて、主たるデータの型にお
ける有効なビット幅およびアドレスのビット幅を保持す
るパラメータ保持手段と、生成すべき機械語命令で用い
られる変数が、データを表す変数である場合、パラメー
タ保持手段が保持するデータのビット幅を有効とする命
令を生成し、アドレスを表す変数である場合、パラメー
タ保持手段が保持するアドレスのビット幅を有効とする
命令を生成する生成手段とを備えている。
SUMMARY OF THE INVENTION In order to solve the above-mentioned problems, a program conversion apparatus according to the present invention is intended for a processor which handles an address having a bit width longer than an effective bit width in a main data type, and uses a high-level language. A program conversion device for generating a machine language instruction based on a program, comprising: parameter holding means for holding an effective bit width and a bit width of an address in a main data type based on a user setting; When the variable used in the machine language instruction is a variable representing data, an instruction for validating the bit width of the data held by the parameter holding unit is generated, and when the variable is an address, the parameter holding unit holds the instruction. Generating means for generating an instruction for validating the bit width of the address.

【0013】前記データのビット幅Mは16であり、前
記アドレスのビット幅Nは17以上31以下であっても
よい。また、前記生成手段は、生成すべき機械語命令が
メモリをアクセスする命令である場合に、アクセス対象
となる変数がデータであるかアドレスであるかに応じ
て、パラメータ保持手段に保持された対応するビット幅
をアクセス幅とすべきことを指示するメモリ管理手段
と、生成すべき機械語命令がレジスタを使用する命令で
ある場合に、そのレジスタにリード又はライトされる変
数がデータであるかアドレスであるか応じて、パラメー
タ保持手段に保持された対応するビット幅を有効とすべ
きことを指示するレジスタ管理手段と、生成すべき機械
語命令が即値を使用する命令である場合にその即値がデ
ータであるかアドレスであるか応じて、パラメータ保持
手段に保持された対応するビット幅の即値を用いるべき
ことを指示する即値管理手段とメモリ管理手段、レジス
タ管理手段、即値管理手段からの指示に従って、機械後
命令を生成するコード生成手段とからなっていてもよ
い。
The bit width M of the data may be 16, and the bit width N of the address may be 17 or more and 31 or less. Further, when the machine language instruction to be generated is an instruction for accessing a memory, the generation unit is configured to store the corresponding instruction stored in the parameter storage unit according to whether a variable to be accessed is data or an address. Memory management means for instructing that a bit width to be used should be an access width, and when a machine language instruction to be generated is an instruction using a register, whether a variable read or written to the register is data or an address. And register management means for instructing that the corresponding bit width held in the parameter holding means should be made valid. If the machine language instruction to be generated is an instruction that uses an immediate value, the immediate value is Immediate value management means for instructing that an immediate value of the corresponding bit width held in the parameter holding means be used depending on whether the data is an address or an address. Memory management unit, the register managing unit, according to an instruction from the immediate managing means may consist of a code generating means for generating machine after instruction.

【0014】また、本発明のプロセッサは、上記プログ
ラム変換装置により生成されたプログラムを実行するプ
ロセッサであって、Nビット長のプログラムカウンタ
と、Nビット長の演算、及びデータのビット幅であるM
ビット長の演算を実行する実行手段とを備えている。
A processor according to the present invention is a processor for executing a program generated by the above-mentioned program conversion device, and comprises an N-bit length program counter, an N-bit length operation, and a bit width M of data.
Execution means for executing a bit-length operation.

【0015】ここで、前記Nは24であり、Mは16で
あってもよい。
Here, N may be 24 and M may be 16.

【0016】[0016]

【作用】上記の手段により本発明のプログラム変換装置
において、生成手段は、生成すべき機械語命令で用いら
れる変数が、データを表す変数である場合、パラメータ
保持手段が保持するデータのビット幅を有効とする命令
を生成する。アドレスを表す変数である場合、パラメー
タ保持手段が保持するアドレスのビット幅を有効とする
命令を生成する。
According to the above-mentioned means, in the program conversion device of the present invention, when the variable used in the machine language instruction to be generated is a variable representing data, the generating means sets the bit width of the data held by the parameter holding means. Generate an instruction to be valid. If it is a variable representing an address, an instruction for validating the bit width of the address held by the parameter holding unit is generated.

【0017】また、前記生成手段において、メモリ管理
手段は、生成すべき機械語命令がメモリをアクセスする
命令である場合に、アクセス対象となる変数がデータで
あるかアドレスであるかに応じて、パラメータ保持手段
に保持された対応するビット幅をアクセス幅とすべきこ
とをコード生成手段に指示する。レジスタ管理手段は、
生成すべき機械語命令がレジスタを使用する命令である
場合に、そのレジスタにリード又はライトされる変数が
データであるかアドレスであるか応じて、パラメータ保
持手段に保持された対応するビット幅を有効とすべきこ
とをコード生成手段に指示する。即値管理手段は、生成
すべき機械語命令が即値を使用する命令である場合にそ
の即値がデータであるかアドレスであるか応じて、パラ
メータ保持手段に保持された対応するビット幅の即値を
用いるべきことをコード生成手段に指示する。
In the generation means, when the machine language instruction to be generated is an instruction for accessing a memory, the memory management means determines whether a variable to be accessed is data or an address. It instructs the code generation means that the corresponding bit width held in the parameter holding means should be used as the access width. The register management means is:
When the machine language instruction to be generated is an instruction that uses a register, the corresponding bit width held in the parameter holding unit is set according to whether the variable read or written to the register is data or an address. It instructs the code generation means to make it valid. When the machine language instruction to be generated is an instruction using an immediate value, the immediate value management means uses the immediate value of the corresponding bit width held in the parameter holding means according to whether the immediate value is data or an address. Instruct the code generation means what to do.

【0018】また、本発明のプロセッサは、N(24)
ビット長のプログラムカウンタにより2のN乗(16メ
ガバイト)のアドレス空間を利用でき、実行手段により
N(24)ビット長の演算、及びデータのビット幅であ
るM(16)ビット長の演算を実行し得る。
Further, the processor according to the present invention has N (24)
A 2 N (16 Mbytes) address space can be used by the bit-length program counter, and the execution means executes an operation of N (24) bits and an operation of M (16) bits, which is the data bit width. I can do it.

【0019】[0019]

【実施例】図1は本発明の実施例におけるマイクロコン
ピュータおよびプログラム変換装置(以下、コンパイラ
と略す。マイクロコンピュータとコンパイラを含めて情
報処理装置と呼ぶ)のブロック図を示す。図1におい
て、本情報処理装置は、C言語プログラムを格納してい
る記憶装置1と、C言語プログラムを機械語プログラム
に翻訳するコンパイラ2と、オブジェクトコードを実行
するハードウェア3とからなる。
FIG. 1 is a block diagram of a microcomputer and a program conversion device (hereinafter, abbreviated as a compiler; an information processing device including a microcomputer and a compiler) according to an embodiment of the present invention. In FIG. 1, the information processing apparatus includes a storage device 1 storing a C language program, a compiler 2 for translating a C language program into a machine language program, and hardware 3 for executing object code.

【0020】コンパイラ2は、以下のものからなる。5
は構文解析部で、C言語プログラムの構文を解析し、プ
ログラム文が中間形式に変換された中間形式文及び中間
コードからなる中間ファイルを生成する。7はコード生
成部で、中間ファイルに基づいてオブジェクトコードを
生成する。
The compiler 2 comprises the following. 5
Is a syntax analysis unit that analyzes the syntax of the C language program and generates an intermediate file including an intermediate format statement and an intermediate code in which the program statement is converted into an intermediate format. A code generation unit 7 generates an object code based on the intermediate file.

【0021】8はパラメータ設定部で、整数型のデータ
変数のビット幅とポインタ変数のビット幅とを保持す
る。本実施例では、予め利用者により整数型のデータ変
数のビット幅が16ビットに、ポインタ変数のビット幅
が24ビットに設定されているものとする。9はメモリ
管理部で、コード生成部7が生成すべきロード・ストア
命令について、その命令の対象となる変数の型に応じ
て、メモリを読み書きするビット幅を指示する。
Reference numeral 8 denotes a parameter setting unit which holds the bit width of an integer data variable and the bit width of a pointer variable. In the present embodiment, it is assumed that the bit width of the integer type data variable is set to 16 bits and the bit width of the pointer variable is set to 24 bits in advance by the user. Reference numeral 9 denotes a memory management unit which designates a bit width for reading and writing from and to a memory in accordance with a type of a variable targeted by the load / store instruction to be generated by the code generation unit 7.

【0022】10はレジスタ管理部で、コード生成部7
が生成すべきレジスタを使用する命令について、レジス
タにリード/ライトされる変数の型に応じて、有効なビ
ット幅を指示する。11は即値管理部で、コード生成部
7が生成すべき即値を用いる命令について、即値である
変数の型に応じて、命令コード中の即値のビット幅を指
示する。
Reference numeral 10 denotes a register management unit, and a code generation unit 7
Specifies an effective bit width according to the type of a variable read / written from / to a register for an instruction using a register to be generated. Reference numeral 11 denotes an immediate value management unit, which instructs the bit width of the immediate value in the instruction code according to the type of the variable that is the immediate value for the instruction using the immediate value to be generated by the code generation unit 7.

【0023】また、ハードウェア3は、以下のものから
なる。13はメモリで、オブジェクトコードおよびプロ
グラムで用いられるデータを格納する。14はアドレス
バスで、24ビットのビット幅を持つ。15はデータバ
スで、16ビットのビット幅を持つ。
The hardware 3 comprises the following. A memory 13 stores object codes and data used in programs. An address bus 14 has a bit width of 24 bits. Reference numeral 15 denotes a data bus having a bit width of 16 bits.

【0024】16はバス制御回路で、アドレスバス14
とデータバス15とを介してメモリ13に接続され、メ
モリ13に格納されたオブジェクトコードを命令として
逐一読み出し、またメモリ13に対してデータを読み書
きする。17は命令制御回路で、プログラムカウンタ1
9を有し、バス制御回路16へ命令アドレスを指示し、
バス制御回路16から命令を受け取り解読する。
A bus control circuit 16 is an address bus 14.
It is connected to the memory 13 via the data bus 15 and reads out the object code stored in the memory 13 as an instruction one by one, and reads and writes data from and to the memory 13. Reference numeral 17 denotes an instruction control circuit, which is a program counter 1
9 to indicate an instruction address to the bus control circuit 16,
An instruction is received from the bus control circuit 16 and decoded.

【0025】プログラムカウンタ19は、24ビットの
命令アドレスを出力する。18は演算実行回路で、レジ
スタファイル20と演算器21からなる。レジスタファ
イル20は、24ビットの複数のレジスタを有する。演
算器21は、レジスタファイル20に保持された値を用
いて24ビット幅の算術論理演算等を実行する。
The program counter 19 outputs a 24-bit instruction address. Reference numeral 18 denotes an operation execution circuit, which comprises a register file 20 and an operation unit 21. The register file 20 has a plurality of 24-bit registers. The arithmetic unit 21 executes a 24-bit arithmetic logic operation using the values held in the register file 20.

【0026】図2は、コード生成部7の処理フローを示
す。ステップ20は、中間ファイルからデータ変数を抽
出して、それぞれの変数に関する情報を載せた変数テー
ブル(シンボルテーブル)を作成する。シンボルテーブ
ルの一例を図7に示す。同図において、シンボル欄はデ
ータ変数のシンボルを、型欄はデータ変数が整数型であ
るかポインタ型であるかを、バイト数欄はそのデータ変
数のバイト数を、先頭アドレス欄はメモリに割り付けら
れている場合の先頭アドレスを、レジスタ欄はレジスタ
が割り当てれている場合のレジスタ名を示す。
FIG. 2 shows a processing flow of the code generator 7. In step 20, data variables are extracted from the intermediate file, and a variable table (symbol table) containing information on each variable is created. FIG. 7 shows an example of the symbol table. In the figure, the symbol column allocates the symbol of the data variable, the type column allocates whether the data variable is of the integer type or the pointer type, the byte number column allocates the number of bytes of the data variable, and the head address column allocates the memory. And the register column shows the register name when a register is assigned.

【0027】ステップ21は、中間ファイルからコード
生成が未処理の中間命令があるか否かを判定する。あれ
ばステップ22に進み、なければコード生成が終了す
る。ステップ22は、中間ファイルから次に処理すべき
順の中間命令を1つ読み出す。ステップ23は、1つの
中間命令を実現する1つ又は複数の機械語命令を選定す
る。
In step 21, it is determined whether or not there is an intermediate instruction whose code has not been processed from the intermediate file. If so, the process proceeds to step 22; otherwise, the code generation ends. Step 22 reads one intermediate instruction in the order to be processed next from the intermediate file. Step 23 selects one or more machine instructions that implement one intermediate instruction.

【0028】ステップ24は、選定された機械語命令か
ら次に処理すべき順の機械語命令を1つ指定する。ステ
ップ25は、指定された1つの機械語命令(以下、個別
命令と呼ぶ)の命令コードを生成する処理(以下、個別
処理と呼ぶ)を行う。ステップ26は、ステップ23で
選定された機械語命令のうち次に処理すべき機械語命令
があるか否かを判定する。あればステップ24に戻り、
なければステップ21に戻る。
Step 24 designates one machine language instruction to be processed next from the selected machine language instruction. Step 25 performs processing (hereinafter, referred to as individual processing) for generating an instruction code of one designated machine language instruction (hereinafter, referred to as individual instruction). A step 26 determines whether or not there is a next machine language instruction to be processed among the machine language instructions selected in the step 23. If so, return to step 24,
If not, the process returns to step 21.

【0029】図3〜図6は、上記ステップ25の個別処
理のフローを示す。第1に、ステップ30は、個別命令
がロード/ストア命令の種類に属するか否かを判定し、
そうである場合はメモリ管理部9に通知し、そうでない
場合ステップ31に進む。この通知を受けたメモリ管理
部9の処理フローを図4に示す。図4において、ステッ
プ40は、その個別命令(ロード/ストア命令)におい
てメモリとの間でロード/ストアすべき変数について、
シンボルテーブルを参照し、その変数の型を調べる。
FIG. 3 to FIG. 6 show the flow of the individual processing in step 25 described above. First, step 30 determines whether the individual instruction belongs to the type of load / store instruction,
If so, the memory management unit 9 is notified; otherwise, the process proceeds to step 31. FIG. 4 shows the processing flow of the memory management unit 9 receiving this notification. In FIG. 4, step 40 is to determine the variables to be loaded / stored with the memory in the individual instruction (load / store instruction)
Look up the symbol table to determine the type of the variable.

【0030】ステップ41は、その変数の型が整数型デ
ータ変数であるか、ポインタ型データ変数であるかを判
定し、前者である場合ステップ42に、後者である場合
ステップ43に進む。ステップ42は、アクセスするデ
ータ幅が2バイトのロード/ストア命令を生成すべきこ
とをコード生成部7に指示し、ステップ31に進む。
In step 41, it is determined whether the type of the variable is an integer type data variable or a pointer type data variable. If it is the former, the process proceeds to step 42, and if it is the latter, the process proceeds to step 43. A step 42 instructs the code generator 7 to generate a load / store instruction having a data width of 2 bytes to be accessed, and the process proceeds to a step 31.

【0031】ステップ43は、アクセスするデータ幅が
3バイトのロード/ストア命令を生成すべきことをコー
ド生成部7に指示し、ステップ31に進む。第2に、ス
テップ31は、個別命令がレジスタを使用するか否かを
判定し、そうである場合はレジスタ管理部10に通知
し、そうでない場合ステップ32に進む。この通知を受
けた場合のレジスタ管理部10の処理フローを図5に示
す。図5において、ステップ50は、その個別命令が使
用するレジスタに格納される変数について、シンボルテ
ーブルを参照し、その変数の型を調べる。
In step 43, the code generator 7 is instructed to generate a load / store instruction having a data width of 3 bytes to be accessed, and the flow advances to step 31. Secondly, step 31 determines whether or not the individual instruction uses a register, and if so, notifies the register management unit 10; otherwise, proceeds to step 32. FIG. 5 shows a processing flow of the register management unit 10 when receiving this notification. In FIG. 5, a step 50 refers to a symbol table for a variable stored in a register used by the individual instruction and checks the type of the variable.

【0032】ステップ51は、その変数の型が整数型デ
ータ変数であるか、ポインタ型データ変数であるかを判
定し、前者である場合ステップ52に、後者である場合
ステップ53に進む。ステップ52は、使用するレジス
タの下位16ビットを有効とする命令を生成すべきこと
をコード生成部7に指示し、ステップ32に進む。
In step 51, it is determined whether the type of the variable is an integer type data variable or a pointer type data variable. If it is the former, the process proceeds to step 52, and if it is the latter, the process proceeds to step 53. A step 52 instructs the code generation unit 7 to generate an instruction for validating the lower 16 bits of the register to be used, and proceeds to a step 32.

【0033】ステップ53は、使用するレジスタの全2
4ビットを有効とする命令を生成すべきことをコード生
成部7に指示し、ステップ32に進む。第3に、ステッ
プ32は、個別命令が即値データを使用するかか否かを
判定し、そうである場合は即値管理部11に通知し、そ
うでない場合ステップ33に進む。この通知を受けた場
合の即値管理部11の処理フローを図6に示す。
In step 53, all the registers 2 to be used are used.
It instructs the code generation unit 7 to generate an instruction that makes 4 bits valid, and proceeds to step 32. Third, step 32 determines whether or not the individual instruction uses immediate data, and if so, notifies the immediate management unit 11; otherwise, proceeds to step 33. FIG. 6 shows a processing flow of the immediate value management unit 11 when receiving this notification.

【0034】図6において、ステップ60は、当該個別
命令において使用する即値データとなる変数について、
シンボルテーブルを参照し、その変数の型を調べる。ス
テップ61は、その変数の型が整数型データ変数である
か、ポインタ型データ変数であるかを判定し、前者であ
る場合ステップ62に、後者である場合ステップ63に
進む。
In FIG. 6, step 60 is a step for variables that are immediate data used in the individual instruction.
Look up the symbol table to determine the type of the variable. In step 61, it is determined whether the type of the variable is an integer type data variable or a pointer type data variable. If the former is the former, the process proceeds to step 62, and if the latter is the latter, the process proceeds to step 63.

【0035】ステップ62は、2バイトの即値を持つ命
令を生成すべきことをコード生成部7に指示し、ステッ
プ33に進む。ステップ63は、3バイトの即値を持つ
命令を生成すべきことをコード生成部7に指示し、ステ
ップ33に進む。第4に、ステップ33は、メモリ管理
部9、レジスタ管理部10、即値管理部11からの指示
があれば、それにしたがって個別命令の命令コードを生
成する。
Step 62 instructs the code generator 7 to generate an instruction having an immediate value of 2 bytes, and proceeds to step 33. A step 63 instructs the code generator 7 to generate an instruction having an immediate value of 3 bytes, and proceeds to a step 33. Fourth, in step 33, if there is an instruction from the memory management unit 9, the register management unit 10, and the immediate value management unit 11, an instruction code of an individual instruction is generated according to the instruction.

【0036】以上のように構成された本実施例のマイク
ロコンピュータおよびプログラム変換装置について、以
下その動作を説明する。説明を簡潔にするために、記憶
装置1に記憶されているC言語プログラムが次に示す場
合を例にあげる。 構文解析部5は、記憶装置1からC言語プログラムを取
り出し、構文を文法に照らして解析して中間形式の言語
で記述された中間ファイルを生成する。この中間ファイ
ルのイメージを以下に示す。ただし、ここでは便宜上、
中間形式の記述を意味がわかるように書き直してある。
The operation of the microcomputer and the program conversion device of the present embodiment configured as described above will be described below. For the sake of simplicity, a C language program stored in the storage device 1 will be described below as an example. The syntax analysis unit 5 extracts the C language program from the storage device 1, analyzes the syntax according to the grammar, and generates an intermediate file described in an intermediate format language. The image of this intermediate file is shown below. However, for convenience,
The description in the intermediate format has been rewritten to make sense.

【0037】中間形式文1: (int *a, b, c) 中間命令1: t1:=*a 中間命令2: t2:=t1+b 中間命令3: t3:=t2+1 中間命令4: c:=t3 中間形式文1は、宣言文int *a, b, c に対応し、中間
命令1〜4は、演算式c= *a + b + 1 に対応する。
Intermediate form statement 1: (int * a, b, c) Intermediate instruction 1: t1: = * a Intermediate instruction 2: t2: = t1 + b Intermediate instruction 3: t3: = t2 + 1 Intermediate instruction 4: c: = t3 The intermediate form statement 1 corresponds to the declaration statement int * a, b, c, and the intermediate instructions 1 to 4 correspond to the arithmetic expression c = * a + b + 1.

【0038】これらの中間形式文、中間命令は、それぞ
れ以下のようにしてオブジェクトコードに変換される。
この中間ファイルが入力されると、コード生成部7は、
中間ファイル中のデータ変数(宣言のないものも含め
て)を抽出し、それぞれの変数の型を調査し、必要があ
ればメモリに割り当て、図7に示したシンボルテーブル
を作成する(図2のステップ20)。
These intermediate form statements and intermediate instructions are respectively converted into object codes as follows.
When this intermediate file is input, the code generation unit 7
The data variables (including those without declarations) in the intermediate file are extracted, the type of each variable is examined, and if necessary, allocated to the memory, and the symbol table shown in FIG. 7 is created (FIG. 2). Step 20).

【0039】上の例では、中間形式文1から明示に宣言
された変数*a,b,cが抽出される。ポインタ変数として宣
言された変数*aは、パラメータ設定部8においてポイン
タ変数のビット幅が24ビットに設定されているので、
メモリ上に24ビット(3バイト)の領域が確保され割
り付けられる。また、整数型データ変数として宣言され
た2つの変数b,cは、パラメータ設定部8において整数
型データ変数のビット幅が16ビットに設定されている
ので、それぞれメモリ上に16ビット(2バイト)の領
域が確保され割り付けられる。ここでは、変数*a,b,c
は、それぞれメモリの1000番地から3バイト、1004番地
から2バイト、1006番地から2バイトの領域に割り当て
られているものとする。ただし、1003番地の1バイトは
空領域である。
In the above example, the variables * a, b, c explicitly declared from the intermediate form statement 1 are extracted. For the variable * a declared as a pointer variable, since the bit width of the pointer variable is set to 24 bits in the parameter setting unit 8,
An area of 24 bits (3 bytes) is secured and allocated on the memory. The two variables b and c declared as integer data variables have 16 bits (2 bytes) in the memory, respectively, because the bit width of the integer data variables is set to 16 bits in the parameter setting unit 8. Are allocated and allocated. Here, the variables * a, b, c
Are allocated to areas of 3 bytes from address 1000, 2 bytes from address 1004, and 2 bytes from address 1006, respectively. However, one byte at address 1003 is an empty area.

【0040】さらに、中間命令1〜4から一時変数t1,t
2,t3が抽出される。一時変数t1,t2,t3は、演算対象とな
る変数に合わせて、それぞれ整数型データ変数として扱
われる。これらの変数に関する情報がシンボルテーブル
に書き込まれる。このシンボルテーブルの内容は、以後
レジスタ割当等の変更があれば、その都度ダイナミック
にその内容が書き換えられる。既に示した図7は、この
時点におけるシンボルテーブルの内容である。この時点
では、レジスタ欄及び一時変数の先頭アドレス欄は、割
当がないので空欄のままである。
Further, temporary variables t1, t
2, t3 is extracted. The temporary variables t1, t2, and t3 are each treated as an integer data variable according to the variable to be operated. Information about these variables is written to the symbol table. The contents of the symbol table are dynamically rewritten each time there is a change in register assignment or the like. FIG. 7 already shown shows the contents of the symbol table at this point. At this point, the register column and the head address column of the temporary variable are left blank because there is no assignment.

【0041】この後、コード生成部7は、中間命令のそ
れぞれについて、以下のようにして対応する機械語命令
を生成する。 << 中間命令1:t1:=*a >>コード生成部7は、中間ファ
イル中に処理すべき(未処理の)中間命令が残っている
か否かを判定する(図2のステップ21)。この時点で
は、中間命令1〜4が残っているので、ステップ22に
進む。
Thereafter, the code generator 7 generates a corresponding machine language instruction for each of the intermediate instructions as follows. << Intermediate instruction 1: t1: = * a >> The code generation unit 7 determines whether an intermediate instruction to be processed (unprocessed) remains in the intermediate file (Step 21 in FIG. 2). At this point, since intermediate instructions 1 to 4 remain, the process proceeds to step 22.

【0042】次に、コード生成部7は、未処理の中間命
令のうち先頭の中間命令を1つ読み出し(ステップ2
2)、その中間命令を実現する1つ又は複数の機械語命
令を選定する(ステップ23)。ステップ23における
中間命令1を実現する1つ又は複数の命令の選定を具体
的に説明する。
Next, the code generation unit 7 reads one head intermediate instruction among the unprocessed intermediate instructions (step 2).
2), select one or a plurality of machine language instructions that realize the intermediate instruction (step 23). The selection of one or more instructions that implement the intermediate instruction 1 in step 23 will be specifically described.

【0043】中間命令1は「ポインタ変数*aが割り当
てられている1000番地から、3バイトを読み出して、
その内容をアドレスとして2バイト読み出して一時変
数t1に格納する。」ことを内容とする。コード生成部7
は、この内容を実現するため上記〜に対応する機械
語命令を選定する。すなわち、アドレス1000番地を即
値データとして、第1のアドレスレジスタに格納するmo
v命令、第1のアドレスレジスタを用いて*aの内容
(ポインタ)をアドレスとして、第2のアドレスレジス
タに読み出すmov命令、第2のアドレスレジスタを用
いて、ポインタが指すデータをデータレジスタに読み出
すmov命令、の3つの命令を選定する。上記第1、第2
のアドレスレジスタは、A0、A1が割り当てられているも
のとする。これは、シンボルテーブルに記入される。
Intermediate instruction 1 reads "3 bytes from address 1000 to which pointer variable * a is assigned,
The content is read out as 2 bytes as an address and stored in a temporary variable t1. " Code generator 7
Selects a machine language instruction corresponding to the above in order to realize this content. That is, mo stored in the first address register with the address 1000 as immediate data
The v instruction, the mov instruction to read the contents (pointer) of * a as an address using the first address register to the second address register, and the data indicated by the pointer to the data register using the second address register The mov instruction is selected. The above first and second
It is assumed that A0 and A1 are assigned to the address register. This is entered in the symbol table.

【0044】<個別命令の生成>さらに、コード生成
部7は、これらの複数の命令の中から処理すべき命令
(個別命令)を1つ指定し(ステップ24)、個別命令
に対する命令コードを生成する(ステップ25)。こ
のステップ25における個別命令の命令コード生成を
図3〜6のフローを用いて具体的に説明する。
<Generation of Individual Instruction> Further, the code generation unit 7 designates one instruction (individual instruction) to be processed from among the plurality of instructions (step 24), and generates an instruction code for the individual instruction. (Step 25). The generation of the instruction code of the individual instruction in step 25 will be specifically described with reference to the flowcharts of FIGS.

【0045】コード生成部7は、ステップ24で指定さ
れた個別命令がメモリアクセスするロード/ストア命
令でなく(図3のステップ30)、レジスタA0を使用す
る命令であるのでレジスタ管理部10にその旨通知する
(ステップ31)。レジスタ管理部10は、シンボルテ
ーブルを参照し(図5のステップ50)、レジスタA0に
格納すべき変数がポインタであることから(ステップ5
1)、レジスタの全24ビットが有効となる命令を生成
すべきことをコード生成部7に対して指示する(ステッ
プ53)。
The code generation unit 7 determines that the individual instruction specified in step 24 is not a load / store instruction for memory access (step 30 in FIG. 3) but an instruction that uses the register A0. To the effect (step 31). The register management unit 10 refers to the symbol table (Step 50 in FIG. 5), and since the variable to be stored in the register A0 is a pointer (Step 5).
1) Instruct the code generation unit 7 to generate an instruction in which all 24 bits of the register are valid (step 53).

【0046】さらに、コード生成部7は、個別命令が
即値データを用いるので即値管理部11にその旨通知す
る(ステップ32)。即値管理部11は、シンボルテー
ブルを参照し(図6のステップ60)、レジスタA0に格
納すべき即値がポインタであることから(ステップ6
1)、3バイトの即値データを有する命令を生成すべき
ことをコード生成部7に対して指示する(ステップ6
3)。
Further, since the individual instruction uses immediate data, the code generation unit 7 notifies the immediate management unit 11 of the fact (step 32). The immediate value management unit 11 refers to the symbol table (Step 60 in FIG. 6), and since the immediate value to be stored in the register A0 is a pointer (Step 6).
1) Instruct the code generation unit 7 to generate an instruction having immediate data of 3 bytes (step 6)
3).

【0047】ステップ53、63からの指示に従って、
コード生成部7は、個別命令に対応する、次に示す命
令1を生成する(ステップ33)。 命令1: MOV #001000,A0 この後コード生成部7は、ステップ23で選定された複
数命令のうち、次の命令コードを生成すべき命令、
が残っているので(ステップ26)、ステップ24に進
む。
According to the instructions from steps 53 and 63,
The code generator 7 generates the following instruction 1 corresponding to the individual instruction (step 33). Instruction 1: MOV # 001000, A0 Thereafter, the code generation unit 7 executes an instruction to generate the next instruction code among the plurality of instructions selected in step 23,
Remain (step 26), the process proceeds to step 24.

【0048】<個別命令の生成>コード生成部7は、
これらの複数の命令の中から処理すべき命令(個別命
令)を1つ指定し(ステップ24)、個別命令に対す
る命令コードを生成する(ステップ25)。このステッ
プ25における個別命令の命令コード生成を図3〜6
のフローを用いて具体的に説明する。
<Generation of Individual Instruction> The code generation unit 7
One instruction (individual instruction) to be processed is designated from the plurality of instructions (step 24), and an instruction code for the individual instruction is generated (step 25). The instruction code generation of the individual instruction in this step 25 is shown in FIGS.
This will be specifically described using the flow of FIG.

【0049】コード生成部7は、個別命令がメモリア
クセスするロード/ストア命令であるので、メモリ管理
部9にその旨通知する(図3のステップ30)。メモリ
管理部9は、シンボルテーブルを参照し(図4のステッ
プ40)、第2のレジスタA1に格納すべき変数がポイン
タであることから(ステップ41)、メモリアクセスに
おけるアクセス幅が3バイトであるロード命令を生成す
べきことをコード生成部7に対して指示する(ステップ
43)。
Since the individual instruction is a load / store instruction for accessing the memory, the code generation unit 7 notifies the memory management unit 9 (step 30 in FIG. 3). The memory management unit 9 refers to the symbol table (Step 40 in FIG. 4), and since the variable to be stored in the second register A1 is a pointer (Step 41), the access width in memory access is 3 bytes. The code generation unit 7 is instructed to generate a load instruction (step 43).

【0050】さらに、コード生成部7は、個別命令が
レジスタA0、A1を使用する命令であるのでレジスタ管理
部10にその旨通知する(ステップ31)。レジスタ管
理部10は、シンボルテーブルを参照し(図5のステッ
プ50)、第2のレジスタA1に格納すべき変数がポイン
タであることから(ステップ51)、レジスタの全24
ビットが有効となる命令を生成すべきことをコード生成
部7に対して指示する(ステップ53)。
Further, since the individual instruction is an instruction using registers A0 and A1, the code generation unit 7 notifies the register management unit 10 of the fact (step 31). The register management unit 10 refers to the symbol table (step 50 in FIG. 5), and since the variable to be stored in the second register A1 is a pointer (step 51), all of the registers 24
The code generation unit 7 is instructed to generate an instruction whose bit is valid (step 53).

【0051】この後、コード生成部7は、個別命令が
即値データを用いないので(ステップ32)、ステップ
33に進む。ステップ43、53からの指示に従って、
コード生成部7は個別命令に対応する、次に示す命令
2を生成する(ステップ33)。 命令2: MOV @A0,A1 この後コード生成部7は、ステップ23で選定された複
数命令のうち、次の命令コードを生成すべき命令が残
っているので(ステップ26)、ステップ24に進む。
Thereafter, the code generator 7 proceeds to step 33 because the individual instruction does not use immediate data (step 32). According to the instructions from steps 43 and 53,
The code generator 7 generates the following instruction 2 corresponding to the individual instruction (step 33). Instruction 2: MOV @ A0, A1 Thereafter, the code generator 7 proceeds to step 24 because there is an instruction to generate the next instruction code among the plurality of instructions selected in step 23 (step 26). .

【0052】<個別命令の生成>個別命令について
も上記と同様にして、コード生成部7は次の命令3を生
成する(ステップ24〜26)。この時点で、一時変数
t1には、D0レジスタが割り当てられている。 命令3: MOV @A1,D0 以下、上記と同様にして、ステップ21〜26のループ
において各中間命令の処理が、ステップ24、25(図
3、4のフロー)、26において各個別命令の処理が行
われるので、詳細な説明は省略して概要を示す。
<Generation of Individual Instruction> For the individual instruction, the code generation unit 7 generates the next instruction 3 in the same manner as described above (steps 24 to 26). At this point, the temporary variable
At t1, a D0 register is assigned. Instruction 3: MOV @ A1, D0 Hereinafter, similarly to the above, the processing of each intermediate instruction in the loop of steps 21 to 26 is performed in steps 24, 25 (flows in FIGS. 3 and 4), and the processing of each individual instruction in steps 26, 26. Is performed, a detailed description is omitted and an outline is shown.

【0053】<< 中間命令2:t2:=t1+b >>この中間命令
は、「変数bが割り当てられている1004番地から2バ
イト読み出して、その内容と一時変数t1とを加算して
一時変数t2に格納する。」ことを内容とする。まず、コ
ード生成部7は、個別命令に対応してA0レジスタの内
容が示す1000番地から4番地離れた番地をロードする命
令4を生成する。その際、メモリ管理部9は、シンボル
テーブルを参照して(ステップ40)、個別命令4が整
数型データ変数をロードすることから(ステップ4
1)、アクセス幅が2バイトのロード命令を生成すべき
ことを指示する(ステップ42)。レジスタ管理部10
は、シンボルテーブルを参照して(ステップ50)、レ
ジスタに整数型データを格納するので(ステップ5
1)、レジスタの下位16ビットが有効となる命令を生
成すべきことを指示する(ステップ52)。この時点
で、レジスタD1には変数bが格納されている。
<< Intermediate instruction 2: t2: = t1 + b >> This intermediate instruction reads "2 bytes from address 1004 to which variable b is assigned, and adds the contents thereof to temporary variable t1 to temporarily Stored in variable t2. " First, the code generation unit 7 generates an instruction 4 for loading an address four addresses away from the address 1000 indicated by the contents of the A0 register corresponding to the individual instruction. At this time, the memory management unit 9 refers to the symbol table (step 40), and the individual instruction 4 loads an integer data variable (step 4).
1) Instruct that a load instruction having an access width of 2 bytes should be generated (step 42). Register management unit 10
Refers to the symbol table (step 50) and stores the integer type data in the register (step 5).
1) Instruct that an instruction in which the lower 16 bits of the register become valid should be generated (step 52). At this point, the variable b is stored in the register D1.

【0054】命令4: MOV @(04,A0),D1 次に、コード生成部7は、個別命令に対応してD1レジ
スタに格納された変数bと、D0レジスタの内容が示す一
時変数t1とを加算して、その結果をD1レジスタに格納す
る命令5を生成する。その際、レジスタ管理部10は、
シンボルテーブルを参照して(ステップ50)、レジス
タに整数型データを格納するので(ステップ51)、レ
ジスタの下位16ビットが有効となる命令を生成すべき
ことを指示する(ステップ52)。この時点で、一時変
数t2にはレジスタD1が割り当てられている。
Instruction 4: MOV @ (04, A0), D1 Next, the code generation unit 7 determines a variable b stored in the D1 register corresponding to the individual instruction and a temporary variable t1 indicated by the contents of the D0 register. Is generated, and an instruction 5 for storing the result in the D1 register is generated. At that time, the register management unit 10
Referring to the symbol table (step 50), since the integer type data is stored in the register (step 51), it is instructed to generate an instruction in which the lower 16 bits of the register are valid (step 52). At this point, the register D1 is assigned to the temporary variable t2.

【0055】命令5: ADD D0,D1 <<中間命令3:t3:=t2+1 >>この中間命令は、「一時
変数t2に1を加算して一時変数t3に格納する」ことを内
容とする。コード生成部7は、レジスタ管理部10、即
値管理部11の指示に従って、2バイトの即値#0001と
レジスタD1とを加算した結果をD1レジスタに格納する次
の命令6を生成する。この時点で、一時変数t3にはレジ
スタD1が割り当てられている。
Instruction 5: ADD D0, D1 << Intermediate instruction 3: t3: = t2 + 1 >> This intermediate instruction has a content that "1 is added to temporary variable t2 and stored in temporary variable t3". I do. The code generation unit 7 generates the next instruction 6 to store the result of adding the 2-byte immediate value # 0001 and the register D1 in the D1 register in accordance with the instructions of the register management unit 10 and the immediate value management unit 11. At this point, the register D1 is assigned to the temporary variable t3.

【0056】命令6: ADD #0001,D1 <<中間命令4:c:=t3 >>この中間命令は「変数cが割
り当てられている1006番地から2バイトの領域に一時変
数t3を書き込む」ことを内容とする。コード生成部7
は、メモリ管理部9の指示に従って、レジスタA1の内容
が示す番地から6番地離れた番地にレジスタD1の内容を
ストアする次の命令7を生成する。
Instruction 6: ADD # 0001, D1 << Intermediate instruction 4: c: = t3 >> This intermediate instruction is "write temporary variable t3 to 2-byte area from address 1006 to which variable c is allocated." The contents. Code generator 7
Generates the next instruction 7 for storing the contents of the register D1 at an address 6 addresses away from the address indicated by the contents of the register A1, according to the instruction of the memory management unit 9.

【0057】命令7: MOV D1,@(06,A0) 上記のようにして各中間命令の処理が終了する。その結
果、コード生成部7から次のようなオブジェクトコード
がメモリ13に対して出力される。メモリ13上で、命
令1から命令7はそれぞれ、100000番地、100005番地、
100007番地、100008番地、10000a番地、10000b番地、10
000f番地に配置されるものとする。
Instruction 7: MOV D1, @ (06, A0) Processing of each intermediate instruction is completed as described above. As a result, the following object code is output from the code generation unit 7 to the memory 13. On the memory 13, the instructions 1 to 7 respectively correspond to addresses 100000, 100005,
Address 100007, address 100008, address 10000a, address 10000b, 10
It shall be located at address 000f.

【0058】 命令1: 100000番地 MOV #001000,A0 命令2: 100005番地 MOV @A0,A1 命令3: 100007番地 MOV @A1,D0 命令4: 100008番地 MOV @(04,A0),D1 命令5: 10000a番地 ADD D0,D1 命令6: 10000b番地 ADD #0001,D1 命令7: 10000f番地 MOV D1,@(06,A0) これらの命令は、オブジェクトコードを便宜上ニモニッ
ク(アセンブリ言語)で表現したものであり、メモリ1
3に格納される際は2進数で表される。上記の数値はす
べて16進数である。以下、メモリ13に配置されたこ
のオブジェクトコードについて、マイクロコンピュータ
により実行される動作を説明する。
Instruction 1: Address 100000 MOV # 001000, A0 Instruction 2: Address 100005 MOV @ A0, A1 Instruction 3: Address 100007 MOV @ A1, D0 Instruction 4: Address 100008 MOV @ (04, A0), D1 Instruction 5: Address 10000a ADD D0, D1 Instruction 6: Address 10000b ADD # 0001, D1 Instruction 7: Address 10000f MOV D1, @ (06, A0) These instructions represent the object code in mnemonics (assembly language) for convenience. , Memory 1
3 is represented by a binary number. All the above numbers are hexadecimal. Hereinafter, an operation performed by the microcomputer for the object code arranged in the memory 13 will be described.

【0059】(命令1:100000番地 MOV #001000,A0
)バス制御回路16および命令制御回路17は、プロ
グラムカウンタ19が保持している値100000をアドレス
バス14に出力し、データバス15を介して命令1をフ
ェッチして解読する。解読結果に従って演算実行回路1
8は、命令1のオペランドで指定されている即値001000
を命令制御回路17から受け取り、レジスタファイル2
0の中のA0レジスタに格納する。
(Instruction 1: Address 100000 MOV # 001000, A0
The bus control circuit 16 and the instruction control circuit 17 output the value 100000 held by the program counter 19 to the address bus 14, and fetch and decode the instruction 1 via the data bus 15. Operation execution circuit 1 according to the decoding result
8 is the immediate value 001000 specified by the operand of instruction 1
From the instruction control circuit 17 and register file 2
Store it in A0 register of 0.

【0060】(命令2:100005番地 MOV @A0,A1 )バ
ス制御回路16および命令制御回路17は、同様にし
て、命令2をフェッチして解読する。演算実行回路18
は、A0レジスタの内容を読み出し、それをアドレスバス
14に出力してメモリ13を読み出し、データバス15
を介して読み出された16ビットのデータをA1レジスタ
の下位16ビットに格納する。続いて、演算実行回路1
8は、演算器21によりA0レジスタの値001000に2を加
算し、バス制御回路16により加算結果001002をアドレ
スバス14に出力してメモリ13を読み出し、データバ
ス15を介して読み出された8ビットのデータをA1レジ
スタの上位8ビットに格納する。
(Instruction 2: MOV @ A0, A1 at 100005) The bus control circuit 16 and the instruction control circuit 17 similarly fetch and decode the instruction 2. Arithmetic execution circuit 18
Reads the contents of the A0 register, outputs it to the address bus 14, reads the memory 13, and reads the data bus 15
Is stored in the lower 16 bits of the A1 register. Subsequently, the operation execution circuit 1
In 8, the arithmetic unit 21 adds 2 to the value 001000 of the A0 register, the bus control circuit 16 outputs the addition result 001002 to the address bus 14, reads the memory 13, and reads 8 via the data bus 15. The bit data is stored in the upper 8 bits of the A1 register.

【0061】(命令3:100007番地 MOV @A1,D0 )バ
ス制御回路16および命令制御回路17は、命令3をフ
ェッチして解読する。演算実行回路18は、A1レジスタ
の内容を読み出し、それをアドレスバス14に出力し、
メモリ13を読み出す。その後演算実行回路18は、デ
ータバス15を介して読み出された16ビットの値をD0
レジスタの下位16ビットに格納する。D0レジスタは、
ポインタ変数*aが指し示すデータを保持することにな
る。
(Instruction 3: MOV @ A1, D0 at address 100007) The bus control circuit 16 and the instruction control circuit 17 fetch and decode the instruction 3. The arithmetic execution circuit 18 reads the contents of the A1 register and outputs it to the address bus 14,
The memory 13 is read. Thereafter, the arithmetic execution circuit 18 converts the 16-bit value read via the data bus 15 to D0
It is stored in the lower 16 bits of the register. The D0 register is
The data pointed to by the pointer variable * a is held.

【0062】(命令4:100008番地 MOV @(04,A0),D1
)バス制御回路16および命令制御回路17は、命令
4をフェッチして解読する。演算実行回路18は、変位
値04を命令制御回路17から受け取り、演算器21にお
いて読み出されたA0レジスタの値001000と加算し、加算
結果001004をバス制御回路16によりアドレスバス14
に出力しメモリ13の読み出しを行う。その後演算実行
回路18は、データバス15に読み出された16ビット
の値をレジスタファイル20の中のD1レジスタの下位1
6ビットに格納する。D1レジスタは、変数bを保持する
ことになる。
(Instruction 4: Address 100008 MOV @ (04, A0), D1
The bus control circuit 16 and the instruction control circuit 17 fetch and decode the instruction 4. The arithmetic execution circuit 18 receives the displacement value 04 from the instruction control circuit 17 and adds the displacement value 04 to the value 001000 of the A0 register read by the arithmetic unit 21, and outputs the addition result 001004 to the address bus 14 by the bus control circuit 16.
To read the data from the memory 13. After that, the arithmetic execution circuit 18 stores the 16-bit value read out to the data bus 15 in the lower one of the D1 register in the register file 20.
Stored in 6 bits. The D1 register holds the variable b.

【0063】(命令5:10000a番地 ADD D0,D1 )バ
ス制御回路16および命令制御回路17は、命令5をフ
ェッチして解読する。演算実行回路18は、演算器21
においてレジスタファイル20から読み出されたD0レジ
スタの値とD1レジスタの値とを加算し、加算結果をレジ
スタファイル20の中のD1レジスタに格納する。演算器
21はこの加算を24ビットで行うが、D1レジスタは下
位16ビットが有効である。D1レジスタは、ポインタ変
数*aが示すデータと変数bとの加算値を保持することに
なる。
(Instruction 5: ADD D0, D1 at address 10000a) The bus control circuit 16 and the instruction control circuit 17 fetch and decode the instruction 5. The arithmetic execution circuit 18 includes an arithmetic unit 21
, The value of the D0 register read from the register file 20 and the value of the D1 register are added, and the addition result is stored in the D1 register in the register file 20. The arithmetic unit 21 performs this addition with 24 bits, but the lower 16 bits of the D1 register are valid. The D1 register holds an added value of the data indicated by the pointer variable * a and the variable b.

【0064】(命令6:10000b番地 ADD #0001,D1 )
バス制御回路16および命令制御回路17は、命令6を
フェッチして解読する。演算実行回路18は、演算器2
1においてレジスタファイル20から読み出されたD1レ
ジスタの値と、命令制御回路17から受け取った即値00
01とを加算し、加算結果をD1レジスタに格納する。D1レ
ジスタは、ポインタ変数*aが示すデータと変数bと即値0
001との加算値を保持することになる。
(Instruction 6: address 10000b ADD # 0001, D1)
The bus control circuit 16 and the instruction control circuit 17 fetch and decode the instruction 6. The arithmetic execution circuit 18 includes the arithmetic unit 2
1, the value of the D1 register read from the register file 20 and the immediate value 00 received from the instruction control circuit 17.
01 is added, and the addition result is stored in the D1 register. The D1 register contains the data indicated by the pointer variable * a, the variable b, and the immediate value 0.
The value added to 001 is held.

【0065】(命令7:10000f番地 MOV D1,@(06,A0)
)バス制御回路16および命令制御回路17は、命令
7をフェッチして解読する。演算実行回路18は、変位
置06を命令制御回路17から受け取り、演算器21にお
いてレジスタファイル20から読み出されたA0レジスタ
の値001000と加算し、加算結果001006をバス制御回路1
6によりデータバス15に出力するとともに、D1レジス
タの下位16ビットの値をデータバス15に出力し、メ
モリ13に対して16ビットデータの書き込みを行う。
メモリ13の001006番地には、ポインタ変数*aが示すデ
ータと変数bと即値0001との加算値が書き込まれること
になる。
(Instruction 7: address 10000f MOV D1, @ (06, A0)
The bus control circuit 16 and the instruction control circuit 17 fetch and decode the instruction 7. The operation execution circuit 18 receives the displacement position 06 from the instruction control circuit 17, adds the value 001000 of the A0 register read from the register file 20 in the operation unit 21, and adds the addition result 001006 to the bus control circuit 1.
6 and outputs the value of the lower 16 bits of the D1 register to the data bus 15, and writes 16-bit data to the memory 13.
At address 001006 of the memory 13, an added value of the data indicated by the pointer variable * a, the variable b, and the immediate value 0001 is written.

【0066】このようにしてC言語プログラムがコンパ
イラ2で翻訳されて生成されたオブジェクトコードが、
ハードウェア3で実行される。以上のように本実施例に
よれば、コンパイラ2が全ての変数と生成するオブジェ
クトコードとのメモリ上での配置を24ビットのアドレ
スで管理し、マイクロコンピュータが24ビットのレジ
スタファイル20および演算器21でこれらのアドレス
を計算し24ビットのアドレスバス14でメモリ13を
アクセスするため、本実施例の情報処理装置はセグメン
トに分割しない全く均一な16メガバイトのアドレス空
間を実現することができ、従ってC言語プログラムを記
述するプログラマはセグメントの境界のような空間の不
均一性を認識する必要がなく、またセグメントレジスタ
の操作のようなアドレス計算での性能劣化も発生しな
い。それに伴ってプログラムの開発効率も向上する。
The object code generated by translating the C language program by the compiler 2 is
It is executed by hardware 3. As described above, according to the present embodiment, the compiler 2 manages the arrangement of all variables and the object code to be generated on the memory by using 24-bit addresses, and the microcomputer uses the 24-bit register file 20 and the arithmetic unit. Since these addresses are calculated at 21 and the memory 13 is accessed via the 24-bit address bus 14, the information processing apparatus of this embodiment can realize a completely uniform 16-megabyte address space which is not divided into segments. A programmer who writes a C language program does not need to be aware of spatial non-uniformity such as segment boundaries, and does not suffer from performance degradation in address calculations such as segment register operations. Along with that, the program development efficiency also improves.

【0067】また、データのビット幅が16ビットで1
6メガバイトのアドレス空間を必要とする応用にとっ
て、本実施例の情報処理装置は、マイクロコンピュータ
が24ビットのレジスタファイル20および演算器21
で構成されるため、従来の32ビットプロセッサのよう
に過分なハードウェアによってコストおよび消費電力が
増大することがない。
The data bit width is 16 bits and 1
For an application requiring an address space of 6 megabytes, the information processing apparatus of the present embodiment uses a 24-bit register file 20 and a computing unit 21.
, There is no increase in cost and power consumption due to excessive hardware as in a conventional 32-bit processor.

【0068】また、マイクロコンピュータの機械語命令
の基本語長は8ビットであり、上記の命令1のように命
令中にアドレスの即値が伴う場合でもその即値は最大で
も24ビットとなるため、コンパイラ2が生成するオブ
ジェクトコードは、機械語命令の基本語長を16または
32ビットとしアドレスの即値が最大32ビットとなる
32ビットプロセッサの情報処理装置に比べて極めて小
さくなる。また64キロバイトのアドレス空間しか扱え
ない16ビットプロセッサに比べても、コードサイズの
増加の要因が命令に伴うアドレスの即値による最大1バ
イトだけであるため、オブジェクトコードのサイズはほ
とんど大きくならない。
The basic word length of the machine language instruction of the microcomputer is 8 bits, and even when the immediate value of the address is included in the instruction as in the above-mentioned instruction 1, the immediate value is at most 24 bits. 2 is much smaller than an information processing device of a 32-bit processor in which the basic word length of a machine language instruction is 16 or 32 bits and the immediate value of an address is a maximum of 32 bits. Also, compared to a 16-bit processor that can handle only a 64-kilobyte address space, the size of the object code hardly increases because the factor of the increase in the code size is only a maximum of 1 byte due to the immediate value of the address accompanying the instruction.

【0069】本実施例のマイクロコンピュータのデータ
バス15の幅は16ビットであるが、これを24ビット
とした場合と比べると、レジスタファイル20に格納さ
れた24ビットのアドレスに関する値をメモリ13に対
して読み書きする時のみ実行時間が長くなるだけであ
り、この性能の低下は、メモリに対して常に32ビット
で読み書きする32ビットプロセッサの情報処理装置の
データバスのビット幅を16ビットにした場合に比べて
極めて小さい。
Although the width of the data bus 15 of the microcomputer of this embodiment is 16 bits, the value related to the 24-bit address stored in the register file 20 is stored in the memory 13 as compared with the case where the width is set to 24 bits. However, only the execution time becomes longer when reading and writing data, and this performance degradation is caused by the fact that the bit width of the data bus of an information processing device of a 32-bit processor that always reads and writes data in 32-bit memory is 16 bits. Very small compared to.

【0070】なお、本実施例は、マイクロコンピュータ
のアドレスバス14、プログラムカウンタ19、レジス
タファイル20および演算器21のビット幅を24ビッ
トとし、コンパイラ2のパラメータ設定部8のポインタ
変数のビット幅を24ビットに設定しているが、これら
を必要とするアドレス空間の広さに対応して17ビット
から31ビットの任意のビット幅にしてもよい。対応は
次のようになる。
In this embodiment, the bit width of the address bus 14, the program counter 19, the register file 20, and the computing unit 21 of the microcomputer is set to 24 bits, and the bit width of the pointer variable of the parameter setting unit 8 of the compiler 2 is set to 24 bits. Although set to 24 bits, an arbitrary bit width of 17 bits to 31 bits may be set according to the required address space. The response is as follows.

【0071】 必要なアドレス空間 ビット幅 128キロバイト 17ビット 256キロバイト 18ビット 512キロバイト 19ビット 1メガバイト 20ビット 2メガバイト 21ビット 4メガバイト 22ビット 8メガバイト 23ビット 16メガバイト 24ビット(本実施例) 32メガバイト 25ビット 64メガバイト 26ビット 128メガバイト 27ビット 256メガバイト 28ビット 512メガバイト 29ビット 1ギガバイト 30ビット 2ギガバイト 31ビット このようにすることにより、アドレスのビット幅を超す
過分なハードウェアがなくなり、応用に応じてコストお
よび消費電力の最適化を図ることができる。
Necessary address space Bit width 128 kilobytes 17 bits 256 kilobytes 18 bits 512 kilobytes 19 bits 1 megabyte 20 bits 2 megabytes 21 bits 4 megabytes 22 bits 8 megabytes 23 bits 16 megabytes 24 bits (this embodiment) 32 megabytes 25 bits 64 megabytes 26 bits 128 megabytes 27 bits 256 megabytes 28 bits 512 megabytes 29 bits 1 gigabyte 30 bits 2 gigabytes 31 bits By doing so, there is no extra hardware that exceeds the bit width of the address. Power consumption can be optimized.

【0072】また本実施例は、マイクロコンピュータの
データバス15の幅を16ビットとしているが、これを
24ビットとしてもよい。また本実施例は、マイクロコ
ンピュータのアドレスバス14、プログラムカウンタ1
9、レジスタファイル20および演算器21のビット幅
とコンパイラ2のパラメータ設定部8のポインタ変数の
ビット幅の設定値とを24ビットとし、コンパイラ2の
パラメータ設定部8のデータ変数のビット幅の設定値を
16ビットとしているが、これらのビット幅を限定する
ものではない。後者をプログラムが主として扱う型のデ
ータのビット幅(Mとする)と等しくし、前者をMより
大きい値(Nとする)とすることにより、情報処理装置
は、主として扱う型のデータのビット幅で表現できる2
のM乗バイトの空間を越える2のN乗バイトのアドレス
空間を扱うことができる。
Although the width of the data bus 15 of the microcomputer is 16 bits in this embodiment, it may be 24 bits. In the present embodiment, the address bus 14 of the microcomputer, the program counter 1
9. The bit width of the register file 20 and the arithmetic unit 21 and the set value of the bit width of the pointer variable of the parameter setting unit 8 of the compiler 2 are set to 24 bits, and the bit width of the data variable of the parameter setting unit 8 of the compiler 2 is set. Although the value is 16 bits, these bit widths are not limited. By making the latter equal to the bit width (M) of data of the type mainly handled by the program, and setting the former to a value larger than M (N), the information processing apparatus enables the bit width of data of the type mainly handled by the program. Can be expressed by 2
Can handle an address space of 2N bytes exceeding the space of M bytes.

【0073】また本実施例は、パラメータ設定部8でビ
ット幅を設定するデータ変数の型を整数型としている
が、これをC言語プログラムで主として扱うデータの型
に合わせていかなる型にしてもよい。また本実施例は、
C言語プログラムをコンパイルして実行するものである
が、言語を限定するものではない。コンパイラ2をプロ
グラムの記述言語に対応させることにより、情報処理装
置はいかなる言語のプログラムでも実行できる。
In this embodiment, the type of the data variable for which the bit width is set by the parameter setting section 8 is an integer type. However, this type may be any type in accordance with the type of data mainly handled in a C language program. . In this embodiment,
It compiles and executes a C language program, but does not limit the language. By making the compiler 2 correspond to the description language of the program, the information processing apparatus can execute a program in any language.

【0074】[0074]

【発明の効果】以上説明してきたたように本発明によれ
ば、パラメータ保持手段にデータ幅及びポインタ幅を任
意に設定できるので、プログラマにセグメントの境界の
ような空間の不均一性を認識させることなく、かつセグ
メントレジスタの操作のようなアドレス計算での性能劣
化をも伴うことなく、主として扱う型のデータのビット
幅で表現できる空間を超える広さの任意のアドレス空間
を扱うことができるという効果がある。
As described above, according to the present invention, the data width and the pointer width can be arbitrarily set in the parameter holding means, so that the programmer can recognize the nonuniformity of the space such as the boundary of the segment. It can handle any address space larger than the space that can be represented by the bit width of the data of the type to be handled, without any performance degradation in address calculation such as segment register operation. effective.

【0075】また、組み込み用途のマイクロコンピュー
タでの応用(アプリケーション)おいては、データのビ
ット幅が16ビット必要で、かつ、アドレス空間が64
キロバイト以上を必要とするが4ギガバイトもの大きさ
を必要としないものに対して最適化を図ることができる
という効果がある。また本発明によれば、従来の32ビ
ットプロセッサの情報処理装置に比べてプログラムのコ
ードサイズが小さく、またデータバスのビット幅が16
ビットの場合でも性能劣化がほとんどない情報処理装置
を実現できるという効果がある。
In an application using an embedded microcomputer, a data bit width is required to be 16 bits and an address space is 64 bits.
There is an effect that optimization can be achieved for a device that requires more than kilobytes but does not require a size of 4 gigabytes. Further, according to the present invention, the code size of the program is smaller than that of the conventional 32-bit processor, and the bit width of the data bus is 16 bits.
Even in the case of bits, there is an effect that an information processing apparatus with almost no performance degradation can be realized.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の実施例における情報処理装置のブロッ
ク図である。
FIG. 1 is a block diagram of an information processing apparatus according to an embodiment of the present invention.

【図2】同実施例におけるコード生成部7の処理フロー
を示す。
FIG. 2 shows a processing flow of a code generation unit 7 in the embodiment.

【図3】同実施例におけるコード生成部7の処理フロー
のうち個別処理のフローを示す。
FIG. 3 shows a flow of individual processing among processing flows of a code generation unit 7 in the embodiment.

【図4】同実施例におけるメモリ管理部9の処理フロー
を示す。
FIG. 4 shows a processing flow of a memory management unit 9 in the embodiment.

【図5】同実施例におけるレジスタ管理部10の処理フ
ローを示す。
FIG. 5 shows a processing flow of a register management unit 10 in the embodiment.

【図6】同実施例における即値管理部11の処理フロー
を示す。
FIG. 6 shows a processing flow of an immediate value management unit 11 in the embodiment.

【図7】同実施例におけるシンボルテーブルを示す。FIG. 7 shows a symbol table in the embodiment.

【符号の説明】[Explanation of symbols]

1 記憶装置 2 コンパイラ 3 ハードウェア 5 構文解析部 7 コード生成部 8 パラメータ設定部 9 メモリ管理部 10 レジスタ管理部 11 即値管理部 13 メモリ 14 アドレスバス 15 データバス 16 バス制御回路 17 命令制御回路 18 演算実行回路 19 プログラムカウンタ 20 レジスタファイル 21 演算器 DESCRIPTION OF SYMBOLS 1 Storage device 2 Compiler 3 Hardware 5 Syntax analysis part 7 Code generation part 8 Parameter setting part 9 Memory management part 10 Register management part 11 Immediate value management part 13 Memory 14 Address bus 15 Data bus 16 Bus control circuit 17 Instruction control circuit 18 Operation Execution circuit 19 Program counter 20 Register file 21 Operation unit

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭61−84735(JP,A) 特開 平4−14144(JP,A) A.V.エイホ他著、原田賢一訳、 「コンパイラ▲II▼原理・技法・ツー ル」、株式会社サイエンス社、1990年11 月10日、P.483−485 (58)調査した分野(Int.Cl.6,DB名) G06F 9/45 G06F 9/30 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-61-84735 (JP, A) JP-A-4-14144 (JP, A) V. Eiho et al., Translated by Kenichi Harada, "Compiler II: Principles, Techniques, and Tools", Science Co., Ltd., November 10, 1990, p. 483−485 (58) Field surveyed (Int.Cl. 6 , DB name) G06F 9/45 G06F 9/30

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 主たるデータの型における有効なビット
幅Mよりも長いビット幅Nをもつアドレスを扱うプロセ
ッサを対象とし、高級言語プログラムに基づいて機械語
命令を生成するプログラム変換装置であって、利用者の設定に基づいて、 主たるデータの型における有
効なビット幅およびアドレスのビット幅を保持するパラ
メータ保持手段と、 生成すべき機械語命令で用いられる変数が、データを表
す変数である場合、パラメータ保持手段が保持するデー
タのビット幅を有効とする命令を生成し、アドレスを表
す変数である場合、パラメータ保持手段が保持するアド
レスのビット幅を有効とする命令を生成する生成手段と
を備えたことを特徴とするプログラム変換装置。
1. A program conversion apparatus for generating a machine language instruction based on a high-level language program for a processor that handles an address having a bit width N longer than an effective bit width M in a main data type, Parameter holding means for holding the effective bit width and the bit width of the address in the main data type based on the setting of the user, and when the variable used in the machine language instruction to be generated is a variable representing data, Generating means for generating an instruction for validating the bit width of the data held by the parameter holding means and generating an instruction for validating the bit width of the address held by the parameter holding means when the variable is an address. A program conversion device characterized in that:
【請求項2】 前記データのビット幅Mは16であり、 前記アドレスのビット幅Nは17以上31以下であるこ
とを特徴とする請求項1記載のプログラム変換装置。
2. The program conversion device according to claim 1, wherein a bit width M of the data is 16, and a bit width N of the address is 17 or more and 31 or less.
【請求項3】 前記生成手段は、 生成すべき機械語命令がメモリをアクセスする命令であ
る場合に、アクセス対象となる変数がデータであるかア
ドレスであるかに応じて、パラメータ保持手段に保持さ
れた対応するビット幅をアクセス幅とすべきことを指示
するメモリ管理手段と、 生成すべき機械語命令がレジスタを使用する命令である
場合に、そのレジスタにリード又はライトされる変数が
データであるかアドレスであるか応じて、パラメータ保
持手段に保持された対応するビット幅を有効とすべきこ
とを指示するレジスタ管理手段と、 生成すべき機械語命令が即値を使用する命令である場合
にその即値がデータであるかアドレスであるか応じて、
パラメータ保持手段に保持された対応するビット幅の即
値を用いるべきことを指示する即値管理手段とメモリ管
理手段、レジスタ管理手段及び即値管理手段からの指示
に従って、機械語命令を生成するコード生成手段とから
なることを特徴とする請求項1又は2記載のプログラム
変換装置。
3. When the machine language instruction to be generated is an instruction for accessing a memory, the generation unit stores the instruction in a parameter storage unit according to whether a variable to be accessed is data or an address. A memory management means for instructing that the corresponding bit width to be used as an access width, and, when the machine language instruction to be generated is an instruction using a register, a variable read or written to the register is data. Register management means for instructing that the corresponding bit width held in the parameter holding means should be validated, depending on whether there is an address or an address; and if the machine language instruction to be generated is an instruction using an immediate value, Depending on whether the immediate value is data or an address,
Code management means for generating a machine language instruction in accordance with instructions from the immediate management means and the memory management means, the register management means and the immediate management means for instructing that an immediate value of the corresponding bit width held in the parameter holding means should be used; 3. The program conversion device according to claim 1, wherein the program conversion device comprises:
【請求項4】 請求項1ないし3記載のいずれかのプロ
グラム変換装置により生成されたプログラムを実行する
プロセッサであって、 Nビット長のプログラムカウンタと、 Nビット長の演算、及びデータのビット幅であるMビッ
ト長の演算を実行する実行手段とを備えたことを特徴と
するプロセッサ。
4. A processor for executing a program generated by the program conversion device according to claim 1, wherein the program counter has an N-bit length, an N-bit operation, and a data bit width. And an execution unit for executing an operation having an M-bit length.
【請求項5】 前記Nは24であることを特徴とする請
求項3記載のプロセッサ。
5. The processor according to claim 3, wherein said N is 24.
JP12621293A 1993-05-27 1993-05-27 Program conversion device and processor Expired - Lifetime JP2875711B2 (en)

Priority Applications (13)

Application Number Priority Date Filing Date Title
JP12621293A JP2875711B2 (en) 1993-05-27 1993-05-27 Program conversion device and processor
EP01202455A EP1164479B1 (en) 1993-05-27 1994-05-27 Program converting unit
EP02076028A EP1229440B1 (en) 1993-05-27 1994-05-27 Program converting unit and processor improved in address management
EP94303862A EP0626641B1 (en) 1993-05-27 1994-05-27 Processor improved in address management
EP02076025A EP1229439A3 (en) 1993-05-27 1994-05-27 Program converting unit and processor improved in address management
DE69434967T DE69434967T2 (en) 1993-05-27 1994-05-27 Program conversion unit and improved addressing processor
DE69432445T DE69432445T2 (en) 1993-05-27 1994-05-27 Improved processor for addressing
EP04075265A EP1416374A3 (en) 1993-05-27 1994-05-27 Program converting unit and processor improved in address management
DE69434971T DE69434971T2 (en) 1993-05-27 1994-05-27 Program Implementation Unit
US08/587,338 US5809306A (en) 1993-05-27 1996-01-16 Variable address length compiler and processor improved in address management
US09/662,484 USRE41959E1 (en) 1993-05-27 2000-09-14 Variable address length compiler and processor improved in address management
US10/991,367 USRE40498E1 (en) 1993-05-27 2004-11-19 Variable address length compiler and processor improved in address management
US11/607,889 US20080320454A1 (en) 1993-05-27 2006-12-04 Variable address length compiler and processor improved in address management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12621293A JP2875711B2 (en) 1993-05-27 1993-05-27 Program conversion device and processor

Publications (2)

Publication Number Publication Date
JPH06337791A JPH06337791A (en) 1994-12-06
JP2875711B2 true JP2875711B2 (en) 1999-03-31

Family

ID=14929508

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12621293A Expired - Lifetime JP2875711B2 (en) 1993-05-27 1993-05-27 Program conversion device and processor

Country Status (1)

Country Link
JP (1) JP2875711B2 (en)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
A.V.エイホ他著、原田賢一訳、「コンパイラ▲II▼原理・技法・ツール」、株式会社サイエンス社、1990年11月10日、P.483−485

Also Published As

Publication number Publication date
JPH06337791A (en) 1994-12-06

Similar Documents

Publication Publication Date Title
US10514922B1 (en) Transfer triggered microcontroller with orthogonal instruction set
USRE41959E1 (en) Variable address length compiler and processor improved in address management
JP3377419B2 (en) Instruction string generation method and apparatus, conversion method, and computer
US6049667A (en) Computer system, method of compiling and method of accessing address space with pointer of different width therefrom
KR101980080B1 (en) Address generation in a data processing apparatus
US5249280A (en) Microcomputer having a memory bank switching apparatus for accessing a selected memory bank in an external memory
US6687808B2 (en) Data processor using indirect register addressing
JP4004915B2 (en) Data processing device
KR19990036893A (en) Processor Architecture for Execution of Multiple Addressing Modes and Its Design Method
JP3106060B2 (en) Signal processor
JP2875711B2 (en) Program conversion device and processor
JP2847688B2 (en) Program conversion device and processor
EP0180077B1 (en) A data processing machine for compiling computer programs
JP2002182926A (en) Compiling method and computer readable recording medium
JP3264901B2 (en) Compiling device and compiling method
JP4545777B2 (en) Data processing device
JPH0666052B2 (en) A computer that automatically maps memory contents to machine registers
US7103751B1 (en) Method and apparatus for representation of an address in canonical form
JP4498338B2 (en) Data processing device
JP3539951B2 (en) Data processing device
JP3345050B2 (en) Two-dimensional array type memory system
JP3236714B2 (en) Program conversion device and program conversion method
JP2002182925A (en) Compiling method and computer readable recording medium
JPS59221747A (en) Digital computer

Legal Events

Date Code Title Description
FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 9

Free format text: PAYMENT UNTIL: 20080114

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090114

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090114

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 11

Free format text: PAYMENT UNTIL: 20100114

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 12

Free format text: PAYMENT UNTIL: 20110114

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110114

Year of fee payment: 12

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 13

Free format text: PAYMENT UNTIL: 20120114

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 14

Free format text: PAYMENT UNTIL: 20130114

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130114

Year of fee payment: 14

EXPY Cancellation because of completion of term