JPH0221331A - Program control system for microcomputer - Google Patents
Program control system for microcomputerInfo
- Publication number
- JPH0221331A JPH0221331A JP17063188A JP17063188A JPH0221331A JP H0221331 A JPH0221331 A JP H0221331A JP 17063188 A JP17063188 A JP 17063188A JP 17063188 A JP17063188 A JP 17063188A JP H0221331 A JPH0221331 A JP H0221331A
- Authority
- JP
- Japan
- Prior art keywords
- program
- selector
- program memory
- memory
- macro
- 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.)
- Pending
Links
- 230000015654 memory Effects 0.000 claims abstract description 79
- 238000000034 method Methods 0.000 claims description 7
- 230000004044 response Effects 0.000 claims description 4
- 230000003247 decreasing effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000008676 import Effects 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
Landscapes
- Executing Machine-Instructions (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明はマイクロコンピュータのプログラム制御方式に
関し、特に−命令で複数の命令を実行できる機能を有す
るマイクロコンピュータのプログラム制御方式に関する
。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a program control system for a microcomputer, and more particularly to a program control system for a microcomputer having a function of executing a plurality of instructions with a -instruction.
従来、マイクロコンピュータにおいて、この種の機能を
実現するためにはマクロアセンブラを用い、プログラム
のソース上で一連の複数の命令をマクロとして定義し、
ソースプログラムのアセンブル時にマクロ置き換え命令
と置き換えて展開するという方式がとられている。Conventionally, in order to realize this type of function in microcomputers, a macro assembler is used to define a series of multiple instructions as a macro in the program source.
When assembling a source program, a method is used in which macro replacement instructions are used to replace and expand the instructions.
上述した従来のマクロアセンブラを用いるマイクロコン
ピュータのプログラム制御方式は、マクロ置き換え命令
とプログラムのソース中でマクロとして定義されている
命令の列とを置きかえて展開するようになっているため
、マクロ置き換えが多数行なわれる場合には、プログラ
ムステップ数が増大するという欠点がある。In the conventional microcomputer program control method using the macro assembler described above, macro replacement instructions are replaced with a sequence of instructions defined as macros in the program source, so macro replacement is difficult. If the program is executed a large number of times, there is a disadvantage that the number of program steps increases.
本発明の目的は、かかるプログラムステップ数を大幅に
削減できるマイクロコンピュータのプログラム制御方式
を提供することにある。An object of the present invention is to provide a microcomputer program control method that can significantly reduce the number of program steps.
本発明のマイクロコンピュータのプログラム制御方式は
、アドレス指定されたプログラムメモリの内容に従った
処理をプロセッサユニットが実行するマイクロコンピュ
ータにおいて、二入力セレクタと、前記セレクタの出力
を命令語とB2て取り込むプロセッサユニットと、前記
プロセッサユニットからの第一のプログラムメモリアド
レス信号により命令語を前記セレクタの第一の入力へ出
力する第一のプログラムメモリと、前記プロセッサユニ
ットからの第二のプログラムメモリアドレス信号により
命令語を前記セレクタの第二の入力へ出力する第二のプ
ログラムメモリとを有し、前記プロセッサユニットから
の制御信号により前記セレクタの出力選択を決定するよ
うに構成される。The program control method for a microcomputer according to the present invention is a microcomputer in which a processor unit executes processing according to the contents of an addressed program memory. a first program memory for outputting an instruction word to a first input of said selector by a first program memory address signal from said processor unit; and a first program memory for outputting an instruction word by a second program memory address signal from said processor unit. a second program memory for outputting a word to a second input of the selector and configured to determine an output selection of the selector by a control signal from the processor unit.
次に、本発明の実施例について図面を参照して説明する
。Next, embodiments of the present invention will be described with reference to the drawings.
第1図は本発明の一実施例を説明するためのプログラム
制御回路のブロック図である。FIG. 1 is a block diagram of a program control circuit for explaining one embodiment of the present invention.
第1図に示すように、プロセッサユニット7はセレクタ
2の出力線5を介して命令語を取り込み実行する。セレ
クタ2はプロセッサユニット7がらの入力選択制御信号
1によってA、Bの2つの入力のうちいずれかを出力と
してi!択する。また、メインメモリとしてのプログラ
ムメモリ4はプロセッサユニット7からのプログラムメ
モリアドレス信号3により対応するプログラムメモリア
ドレスの内容を出力線6を介してセレクタ2の一方の入
力Aへ出力する。また、マクロメモリとしてのプログラ
ムメモリ11はプロセッサユニット(以下プロセッサと
略す)がらのプログラムメモリアドレス信号10により
対応するプログラムメモリアドレスの内容を出力線12
を介してセレクタ2の他方の入力Bへ出力する。As shown in FIG. 1, the processor unit 7 receives a command via the output line 5 of the selector 2 and executes it. The selector 2 outputs either one of the two inputs A and B according to the input selection control signal 1 from the processor unit 7 and selects i! Choose. Further, the program memory 4 as the main memory outputs the contents of the corresponding program memory address to one input A of the selector 2 via the output line 6 in response to the program memory address signal 3 from the processor unit 7 . Further, the program memory 11 as a macro memory transmits the contents of the corresponding program memory address to an output line 12 by a program memory address signal 10 from a processor unit (hereinafter abbreviated as processor).
It is output to the other input B of the selector 2 via.
次に、第2図(a)、(b)を参照して本発明のプログ
ラム制御動作を説明する。Next, the program control operation of the present invention will be explained with reference to FIGS. 2(a) and 2(b).
第2図(a)、(b)はそれぞれ第1図におけるメイン
プログラムメモリおよびマクロメモリ内の部分的プログ
ラム図がある。2(a) and 2(b) are partial program diagrams in the main program memory and macro memory in FIG. 1, respectively.
第2図(a>、(b)に示すように、メインプログラム
メモリ内のプログラノ\はプロゲラ11メモリ4に格納
され、マクロメモリ内プログラムはプログラムメモリ1
1に格納されている。また、プロセッサ7にはA、82
つのレジスタがあり、数値の格納や演算に使用している
。As shown in FIGS. 2(a) and (b), the program program in the main program memory is stored in the program memory 11 memory 4, and the program in the macro memory is stored in the program memory 1.
It is stored in 1. In addition, the processor 7 has A, 82
There are two registers, which are used for storing and calculating numbers.
まず、メインメモリのアドレス100に格納されている
rMOV A、#OJは即時データ(以下、イミディ
エイトデータと略す)の゛0パをAレジスタにロードし
、アドレス101に格納されているrMOV B、#
11は前記イミディエイトデータの1″をBレジスタに
ロードし、アドレス102.104,106にある「マ
クロ実行命令1はセレクタ2の人力をマクロメモリより
取り込む指示をするものとする。また、一方、マクロメ
モリ内のアドレス0に格納されているrMULA、#1
01はイミディエイトデータの“’ 10 ”とAレジ
スタの内容の乗算結果をAレジスタにロードし、アドレ
ス1のrADD A。First, the rMOV A, #OJ stored at address 100 of the main memory loads 0 of immediate data (hereinafter abbreviated as immediate data) into the A register, and the rMOV B, #OJ stored at address 101 loads
11 loads the immediate data 1'' into the B register, and the macro execution instruction 1 at addresses 102, 104, and 106 instructs to import the human power of selector 2 from the macro memory. rMULA, #1 stored at address 0 in memory
01 loads the result of multiplying the immediate data "'10" and the contents of the A register into the A register, and rADD A at address 1.
B1はAレジスタの内容とBレジスタの内容の加算結果
をAレジスタにロードし、アドレス2の[マクロ終了命
令1はセレクタ2の入力をメインプログラムメモリより
取り込む指示をする命令である。B1 loads the result of addition of the contents of the A register and the contents of the B register into the A register, and the macro end instruction 1 at address 2 is an instruction to fetch the input of the selector 2 from the main program memory.
次に、プロセッサ7はメインプログラムメモリ4内の命
令を実行してきて、100番地と101番地の命令を実
行したとする。そのとき、Aレジスタは°“O”、Bレ
ジスタは1′′が入っている。次に、102番地のマク
ロ実行命令を実行すると、プロセッサ7は信号線1によ
りセレクタ2のB側より入力しマクロメモリ11内のプ
ログラムを実行し始める。従って、マクロメモリ11に
あるプログラムの0番地、1番地の命令を実行後は、A
レジスタは“1 ” 、Bレジスタも“1′′が入って
いる。次に、2番地のマクロ終了命令を実行すると、プ
ロセッサ7は信号線1によりセレクタ2のA側より入力
し、メインプログラムメモリ4内の103番地の命令か
ら実行を始める。以下、同様に実行を続け、107番地
の命令を実行する直前にはAレジスタには’123”、
Bレジスタには“°3′°が入っている。すなわち、プ
ロセッサ7はメインプログラムメモリ4内の[マクロ実
行命令Jの部分をマクロメモリ11内の0番地と1番地
の命令列で置き換えたプログラムと等価なプログラムを
実行したことになる。Next, it is assumed that the processor 7 executes the instructions in the main program memory 4 and executes the instructions at addresses 100 and 101. At this time, the A register contains °"O" and the B register contains 1''. Next, when the macro execution instruction at address 102 is executed, the processor 7 receives input from the B side of the selector 2 through the signal line 1 and starts executing the program in the macro memory 11. Therefore, after executing the instructions at addresses 0 and 1 of the program in the macro memory 11, A
The register contains "1" and the B register also contains "1".Next, when the macro end instruction at address 2 is executed, the processor 7 inputs the signal from the A side of the selector 2 via the signal line 1 and stores it in the main program memory. Execution starts from the instruction at address 103 in 4. From here on, execution continues in the same way, and just before executing the instruction at address 107, '123' is stored in the A register.
The B register contains "°3'°. That is, the processor 7 executes the program in which the macro execution instruction J part in the main program memory 4 is replaced with the instruction sequence at addresses 0 and 1 in the macro memory 11. This means that you have executed a program equivalent to .
このように、本実施例はマクロアセンブラと同等の機能
をハードウェアで実現していることになる。In this way, this embodiment realizes the same function as a macro assembler using hardware.
第3図は本発明の第二の実施例を説明するためのプログ
ラム制御回路のブロック図である。FIG. 3 is a block diagram of a program control circuit for explaining a second embodiment of the present invention.
第3図に示すように、本実施例のプロセッサユニット7
はセレクタ2の出力線5を介して命令語を取り込み実行
する。また、セレクタ2はプロセッサユニット7からの
入力選択信号線1により、A、Hの二つの入力のうちい
ずれかを選択する。As shown in FIG. 3, the processor unit 7 of this embodiment
takes in the command word via the output line 5 of the selector 2 and executes it. Further, the selector 2 selects one of the two inputs A and H using the input selection signal line 1 from the processor unit 7.
メインメモリとしてのプログラムメモリ4はプロセッサ
ユニット7からのプログラムメモリアドレス信号3によ
り対応するプログラムメモリアドレスの内容を出力線6
を介してセレクタ2の一方の入力Aへ出力する。本実施
例においては、新らたにアドレス発生回路24とマクロ
メモリとしてのプログラムメモリ26〜28を設けるが
、アドレス発生回路24はプロセッサユニット7からの
制御信号23によって1つずつ増加するプログラムメモ
リアドレスを出力線25を介してプログラムメモリ26
〜28へ出力する。このプログラムメモリ26〜28は
プログラムメモリアドレス信号@25に対応するデータ
を出力線29〜31に出力するので、セレクタ21はプ
ロセッサユニット7からの入力選択制御信号20によっ
て29〜31のいずれかを選択し出力線22を介してセ
レクタ2の他方の入力Bへデータを出力する。A program memory 4 serving as a main memory outputs the contents of a corresponding program memory address by a program memory address signal 3 from a processor unit 7 to an output line 6.
It is output to one input A of the selector 2 via the . In this embodiment, an address generation circuit 24 and program memories 26 to 28 as macro memories are newly provided. program memory 26 via output line 25
-Output to 28. Since the program memories 26 to 28 output data corresponding to the program memory address signal @25 to the output lines 29 to 31, the selector 21 selects one of 29 to 31 by the input selection control signal 20 from the processor unit 7. The data is then output to the other input B of the selector 2 via the output line 22.
次に、第4[g(a)〜(d)を参照してそのプログラ
ム制御動作を説明する。Next, the program control operation will be explained with reference to No. 4 [g(a) to (d)].
第4図(a)〜(d)はそれぞれ第3図におけるメイン
プログラムメモリおよびマクロプログラムメモリ内の部
分的プログラム図である。FIGS. 4(a) to 4(d) are partial program diagrams in the main program memory and macro program memory in FIG. 3, respectively.
第4図(a)〜(d)に示すように、マクロメモリ1内
のプログラムはプログラムメモリ26に、マクロメモリ
2内のプログラムはプログラムメモリ27に、マクロメ
モリ3内のプログラムはプログラムメモリ28にそれぞ
れ格納されるプログラムである。As shown in FIGS. 4(a) to (d), the program in macro memory 1 is stored in program memory 26, the program in macro memory 2 is stored in program memory 27, and the program in macro memory 3 is stored in program memory 28. These are programs stored respectively.
まず、プロセッサ7は前述した第一の実施例と同様に、
メインプログラムメモリ4内の命令を実行してきて、1
01番地の命令を実行するが、そのときAレジスタは0
である。また、プロセッサ7は信号123をアクティブ
にするので、アドレス発生回路24はOより始まるプロ
グラムメモリアドレスを発生する。このプログラムメモ
リアドレスにより、マクロメモリ1〜3は0番地のデー
タを出力線29〜31へ出力すると、セレクタ21はプ
ロセッサ7からの入力選択信号線20によって制御され
、プログラムメモリ26からの出力線29を選択しセレ
クタ2のB側へ送出する。First, the processor 7 similarly to the first embodiment described above,
Execute the instructions in the main program memory 4,
The instruction at address 01 is executed, but at that time the A register is 0.
It is. Also, since the processor 7 activates the signal 123, the address generation circuit 24 generates a program memory address starting from O. Based on this program memory address, the macro memories 1 to 3 output the data at address 0 to the output lines 29 to 31, and then the selector 21 is controlled by the input selection signal line 20 from the processor 7, and the output line 29 from the program memory 26 is selected and sent to the B side of selector 2.
プロセッサ7はセレクタ2とセレクタ21を介してマク
ロメモリ1の命令を取り込み実行を始める。マクロメモ
リ1内の0番地と1番地の命令実行後はAレジスタの内
容は1である。さらに、2番地のマクロ終了命令を実行
すると、プロセッサ7は入力選択信号1によりメインプ
ログラムメモリ4より命令を取り込み始める。Processor 7 takes in instructions from macro memory 1 via selector 2 and selector 21 and starts executing them. After the instructions at addresses 0 and 1 in macro memory 1 are executed, the contents of the A register are 1. Further, when the macro end instruction at address 2 is executed, the processor 7 starts fetching instructions from the main program memory 4 in response to the input selection signal 1.
以下同様にして、103番地の命令まで実行し、104
番地の命令を実行する直前にはAレジスタの内容は6で
ある。すなわち、メインプログラムメモリ4内のプログ
ラムのマクロ1〜3実行命令はマクロメモリ1〜3内の
命令列で置き換えたものと等価な結果を示す。In the same manner, execute the instruction up to address 103, and then execute the instruction at address 104.
Immediately before executing the instruction at the address, the contents of the A register are 6. That is, the macros 1 to 3 execution instructions of the program in the main program memory 4 show results equivalent to those replaced by the instruction strings in the macro memories 1 to 3.
従って、本実施例によれば、同時に任意の異なるマクロ
実行命令を使用できるという利点がある。Therefore, this embodiment has the advantage that any different macro execution instructions can be used at the same time.
以上説明したように、本発明のマイクロコンピュータの
プログラム制御方式は、ごくわずかなマクロメモリを付
加し命令列の置き換え機能および実行をハードウェアで
実現することにより、プログラムステップ数を大幅に削
減することができるという効果がある。またサブルーチ
ンと比較すると、本発明はレジスタの退避、復帰等が必
要ないので、実行時間が短くなるという効果もある。As explained above, the microcomputer program control method of the present invention can significantly reduce the number of program steps by adding a very small amount of macro memory and realizing the instruction sequence replacement function and execution in hardware. It has the effect of being able to. Furthermore, compared to subroutines, the present invention does not require saving or restoring registers, so it has the effect of shortening the execution time.
例えば、5ステツプのマクロ命令列を定義しマクロの置
き換えは100回行なわれると、従来のマクロアセンブ
ラを用いるときは、500ステツプを要するが、本発明
では100ステツプを要するのみであり、しかもマクロ
メモリ内に6ステツプの命令列を要するのみである。For example, if a 5-step macro instruction string is defined and the macro is replaced 100 times, 500 steps are required when using a conventional macro assembler, but with the present invention, only 100 steps are required, and the macro memory is replaced 100 times. It only requires a 6-step instruction sequence.
ムメモリおよびマクロメモリ内の部分的プログラム図で
ある・。2 is a partial program diagram in system memory and macro memory.
1.20・・・入力選択制御信号、2,21・・・セし
フタ2.3.10・・・プログラムメモリアドレス信号
、4,11.26〜28・・・プログラムメモリ、5・
・・命令語大力バス、6,12.29〜31・・・記憶
データ出力線、7・・・プロセッサユニット、22・・
・選択データ出力線、23・・・アドレス発生回路制御
信号線、24・・・アドレス発生回路、25・・・プロ
グラムメモリアドレス信号。1.20...Input selection control signal, 2,21...Set lid 2.3.10...Program memory address signal, 4,11.26-28...Program memory, 5.
...Instruction word power bus, 6,12.29-31...Stored data output line, 7...Processor unit, 22...
- Selected data output line, 23...Address generation circuit control signal line, 24...Address generation circuit, 25...Program memory address signal.
第1図は本発明の第一の実施例を説明するためのプログ
ラム制御回路のブロック図、第2図(a>、(b)はそ
れぞれ第1図におけるメインプログラムメモリ内の部分
的プログラム図、第3図は本発明の第二の実施例を説明
するためのプログラム制御回路のブロック図、第4図(
a)〜(d)はそれぞれ第3図におけるメインプロゲラ
第 1 口
第 j 図
第 72
マクロメモ1月内プロゲフム
図FIG. 1 is a block diagram of a program control circuit for explaining the first embodiment of the present invention, and FIGS. 2(a) and (b) are partial program diagrams in the main program memory in FIG. 1, respectively. FIG. 3 is a block diagram of a program control circuit for explaining the second embodiment of the present invention, and FIG.
a) to (d) are the main progera 1st mouth j figure 72 macro memo January progehum figure in figure 3, respectively.
Claims (1)
処理をプロセッサユニットが実行するマイクロコンピュ
ータにおいて、二入力セレクタと、前記セレクタの出力
を命令語として取り込むプロセッサユニットと、前記プ
ロセッサユニットからの第一のプログラムメモリアドレ
ス信号により命令語を前記セレクタの第一の入力へ出力
する第一のプログラムメモリと、前記プロセッサユニッ
トからの第二のプログラムメモリアドレス信号により命
令語を前記セレクタの第二の入力へ出力する第二のプロ
グラムメモリとを有し、前記プロセッサユニットからの
制御信号により前記セレクタの出力選択を決定すること
を特徴とするマイクロコンピュータのプログラム制御方
式。A microcomputer in which a processor unit executes processing according to the contents of an addressed program memory, comprising a two-input selector, a processor unit that takes in the output of the selector as an instruction word, and a first program memory from the processor unit. a first program memory for outputting instruction words to a first input of said selector in response to an address signal; and a second program memory for outputting instruction words to a second input of said selector in response to a second program memory address signal from said processor unit. 1. A program control method for a microcomputer, characterized in that the program control method for a microcomputer has two program memories, and the output selection of the selector is determined by a control signal from the processor unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP17063188A JPH0221331A (en) | 1988-07-08 | 1988-07-08 | Program control system for microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP17063188A JPH0221331A (en) | 1988-07-08 | 1988-07-08 | Program control system for microcomputer |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0221331A true JPH0221331A (en) | 1990-01-24 |
Family
ID=15908453
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP17063188A Pending JPH0221331A (en) | 1988-07-08 | 1988-07-08 | Program control system for microcomputer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0221331A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08194614A (en) * | 1995-01-19 | 1996-07-30 | Nec Corp | Microcomputer |
JP2006058048A (en) * | 2004-08-18 | 2006-03-02 | Agilent Technol Inc | Optimization method for pattern generation program, program, and signal generator |
-
1988
- 1988-07-08 JP JP17063188A patent/JPH0221331A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08194614A (en) * | 1995-01-19 | 1996-07-30 | Nec Corp | Microcomputer |
JP2006058048A (en) * | 2004-08-18 | 2006-03-02 | Agilent Technol Inc | Optimization method for pattern generation program, program, and signal generator |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPS6239780B2 (en) | ||
JPS5975347A (en) | Simulation device of logical circuit | |
US5586337A (en) | Programmable controller with timing control | |
JPH0683615A (en) | Computer for executing instruction set emulation | |
JPH0221331A (en) | Program control system for microcomputer | |
JPS601655B2 (en) | Data prefetch method | |
JPH05143447A (en) | Digital processor and control method for the processor | |
JPH07110769A (en) | Vliw type computer | |
JPS6116334A (en) | Data processor | |
KR950006585B1 (en) | Micro program control apparatus and control method thereof | |
JPH04230533A (en) | Interruption control circuit | |
JPS6086625A (en) | Data processing device | |
JPS61194534A (en) | Microprocessor | |
JPH0557614B2 (en) | ||
JPS6015969B2 (en) | Microinstruction address generation method | |
JP2003122628A (en) | Digital signal processor, program converter and communication system having digital signal processor | |
JPS6191724A (en) | Microprogram controller | |
JPS63123137A (en) | Address coincidence signal generating system | |
JPH05189015A (en) | Programmable controller | |
JPH06301532A (en) | Microprocessor unit | |
JPH0531170B2 (en) | ||
JPH04149733A (en) | Sequence control system | |
JPH03257572A (en) | Multiprocessor system | |
JPH05189014A (en) | Programmable controller | |
JPH0682321B2 (en) | Micro controller |