JPH0728644A - Data processor - Google Patents

Data processor

Info

Publication number
JPH0728644A
JPH0728644A JP17181093A JP17181093A JPH0728644A JP H0728644 A JPH0728644 A JP H0728644A JP 17181093 A JP17181093 A JP 17181093A JP 17181093 A JP17181093 A JP 17181093A JP H0728644 A JPH0728644 A JP H0728644A
Authority
JP
Japan
Prior art keywords
storage means
instruction
address
control signal
control terminal
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
Application number
JP17181093A
Other languages
Japanese (ja)
Inventor
Masuhide Ikeda
益英 池田
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP17181093A priority Critical patent/JPH0728644A/en
Publication of JPH0728644A publication Critical patent/JPH0728644A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To report misprogramming which breaches the restrictions of the number of nests of subroutine calls to the outside by enabling a call and a return instruction and shortening the length of a microprogram, decreasing the physical size of a memory, and further monitoring the number of nests of the subroutine calls of the microprogram stored in the memory. CONSTITUTION:The output of an instruction register 102 is connected to a program counter 110 and a storage means 104 for storing an address is added to the program counter 101. Further, a circuit 121 which monitors the nesting state of the subroutine calls is provided. Consequently, a branch instruction is actualized and the length of the microprogram can be shortened. The misprogramming which breaches the restrictions of the number of nests of the subroutine calls can be reported to the outside, so the burden on a programmer is lightened.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、メモリを内蔵した中央
演算処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a central processing unit having a built-in memory.

【0002】[0002]

【従来の技術】従来のデータ処理装置は、図2に示すよ
うに、番地計数手段110(以下、プログラムカウンタ
という)は、命令情報記憶手段101(以下、メモリと
いう)のアドレス信号線群117に接続され、メモリ1
01は、アドレス信号線群117に対応した命令信号を
命令格納手段102(以下命令レジスタという)へ出力
し、命令レジスタ102は、メモリ101に格納された
命令の制御対象となっているレジスタや演算処理装置等
へデータを送るという構成であった。なお制御信号発生
回路109はプログラムカウンタ110及び命令レジス
タ102の動作を制御する制御信号111から114及
び103を発生する回路である。
2. Description of the Related Art In a conventional data processing apparatus, as shown in FIG. 2, an address counting means 110 (hereinafter referred to as a program counter) is provided in an address signal line group 117 of an instruction information storage means 101 (hereinafter referred to as a memory). Connected, memory 1
01 outputs an instruction signal corresponding to the address signal line group 117 to the instruction storage unit 102 (hereinafter referred to as an instruction register), and the instruction register 102 is a register or an arithmetic operation target of the instruction stored in the memory 101. It was configured to send data to a processing device or the like. The control signal generation circuit 109 is a circuit that generates control signals 111 to 114 and 103 for controlling the operations of the program counter 110 and the instruction register 102.

【0003】しかし前述の従来技術では、プログラムカ
ウンタ110にメモリアドレスのインクリメント機能し
か存在せず、そのため最終アドレスまでカウントアップ
されるまで分岐することなく全てのメモリ101上の命
令を常に実行することになり、複雑な処理を行う場合に
メモリ101に格納された命令群であるマイクロプログ
ラムが長くなってしまい、メモリの物理的サイズが大き
くなるという第1の問題点を有していた。
However, in the above-mentioned conventional technique, the program counter 110 has only a memory address increment function, so that the instructions on all the memories 101 are always executed without branching until the count up to the final address. Therefore, the first problem is that the microprogram, which is a group of instructions stored in the memory 101, becomes long when performing complicated processing, and the physical size of the memory becomes large.

【0004】また、仮に分岐命令が実行可能なハードウ
ェアへ改良することにより前記第1の問題点を解決した
としても、プログラムの中で同じ処理を複数回使用する
場合は、プログラムの長さがプログラム中の処理回数に
比例する事になりメモリ101の物理的サイズが大きく
なるという第2の問題点を有していた。
Further, even if the first problem is solved by improving the hardware capable of executing a branch instruction, the length of the program is reduced when the same process is used a plurality of times in the program. There is a second problem that the physical size of the memory 101 becomes large because it is proportional to the number of times of processing in the program.

【0005】さらに、マイクロプログラム中のサブルー
チンのネスティング数が番地一時記憶手段の記憶容量を
越える場合は、データ処理装置が誤動作してしまうとい
う第3の問題点を有していた。
Further, there is a third problem that the data processing device malfunctions when the nesting number of the subroutine in the microprogram exceeds the storage capacity of the address temporary storage means.

【0006】[0006]

【発明が解決しようとする課題】本発明の目的は、プロ
グラムカウンタの情報をプログラムで変更可能にすると
共にジャンプ処理終了後の戻りアドレスを記憶可能と為
し、その結果マイクロプログラムを短くしてメモリの物
理的サイズを小さくするところにある。本発明の更なる
目的は、メモリに格納されたマイクロプログラムのサブ
ルーチンコールのネスティング数を監視し、エラー発生
出力信号を外部へ出力することにより、サブルーチンコ
ールのネスティング数の制約を破るプログラミングミス
を外部へ知らしめるところにある。
SUMMARY OF THE INVENTION An object of the present invention is to make it possible to change the information of the program counter by a program and store the return address after the end of the jump process. Is to reduce the physical size of. A further object of the present invention is to monitor the nesting number of the subroutine calls of the microprogram stored in the memory and output the error occurrence output signal to the outside so that programming mistakes that violate the constraint of the nesting number of the subroutine calls can be performed externally. There is a place to inform.

【0007】[0007]

【課題を解決するための手段】上記目的は、命令情報が
格納された命令情報記憶手段と、該命令情報を受け記憶
保持する命令格納手段と、該命令格納手段の出力データ
に応じ制御信号群を発生する制御信号発生回路と、該制
御信号発生回路の出力信号を基準クロックとして受け該
基準クロックを計数し該命令情報記憶手段の番地を決定
する番地計数手段とにより構成されるデータ処理装置に
おいて、該命令格納手段の出力信号の一部を該番地計数
手段へ転送する経路を設けたことにより達成される。
The above-mentioned object is to provide a command information storage means for storing command information, a command storage means for receiving and storing the command information, and a control signal group according to output data of the command storage means. In a data processing device comprising a control signal generating circuit for generating a signal and an address counting means for receiving an output signal of the control signal generating circuit as a reference clock and counting the reference clock to determine an address of the instruction information storage means. This is achieved by providing a path for transferring a part of the output signal of the instruction storing means to the address counting means.

【0008】また前記目的は、前記命令格納手段の任意
の命令情報に応じた前記制御信号発生回路からの制御信
号により制御される少なくとも1つの番地一時記憶手段
を設けたことにより達成される。
Further, the above object can be achieved by providing at least one address temporary storage means controlled by a control signal from the control signal generation circuit according to arbitrary instruction information of the instruction storage means.

【0009】前記目的は更に、前記命令格納手段の任意
の命令情報に応じた前記制御信号発生回路からの制御信
号により制御される監視回路付き番地一時記憶手段を設
けたことにより達成される。
The above object is further achieved by providing an address temporary storage means with a monitoring circuit which is controlled by a control signal from the control signal generating circuit according to arbitrary instruction information in the instruction storage means.

【0010】[0010]

【実施例】以下、本発明の一実施例を図1及び図3から
図15を用いて説明する。図1は、本発明の一実施例を
示した図である。メモリ101はアドレス信号線群11
7と接続しているアドレス端子10本と、第1の出力信
号線群118(以下メモリ出力信号線群という)と接続
しているメモリ出力端子を16本具備している。すなわ
ち、メモリ101は、1024ワード X 16ビット
の読みだし専用メモリに相当する。命令レジスタ102
は、第1信号線群118(以下、メモリ出力信号線群と
いう)を介してメモリ101からの命令情報を取り込
み、取り込みタイミングは、第10の制御端子103よ
り入力される制御信号により決められる。命令レジスタ
102は自身が保持する命令情報の一部を、第1の制御
信号線群107を介してプログラムカウンタ110及び
同図に記載されていない汎用レジスタ等へ、また第2の
制御信号線群108を介して制御信号発生回路109へ
供給する。プログラムカウンタ110は、その計数値を
第2の出力信号線群119を介して番地一時記憶手段1
04に出力し、また番地一時記憶手段104は、一時的
に保持している計数値を第3の出力信号線群120を介
してプログラムカウンタ110へ戻すことが可能であ
る。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to FIGS. 1 and 3 to 15. FIG. 1 is a diagram showing an embodiment of the present invention. The memory 101 includes the address signal line group 11
It has 10 address terminals connected to 7 and 16 memory output terminals connected to the first output signal line group 118 (hereinafter referred to as memory output signal line group). That is, the memory 101 corresponds to a read-only memory of 1024 words × 16 bits. Instruction register 102
Takes in command information from the memory 101 via the first signal line group 118 (hereinafter referred to as memory output signal line group), and the take-in timing is determined by the control signal inputted from the tenth control terminal 103. The instruction register 102 transfers a part of the instruction information held by itself to the program counter 110 and a general-purpose register not shown in the figure via the first control signal line group 107, and the second control signal line group. The signal is supplied to the control signal generation circuit 109 via 108. The program counter 110 stores the count value in the address temporary storage means 1 via the second output signal line group 119.
The address temporary storage means 104 can return the count value temporarily held to the program counter 110 via the third output signal line group 120.

【0011】図3は、図1内に記載されているプログラ
ムカウンタ110の一実施例を示した図である。プログ
ラムカウンタ110は、第1の記憶手段301、半加算
器302、及び第2の記憶手段303を1ブロック分と
考えると、10ブロックで構成されている。第1の記憶
手段301は、図4に示した回路で構成される。図4内
に記載されている第5の記憶手段401は、端子CがL
OWのとき端子Dと端子Mが導通状態、すなわち端子D
に与えられた信号が端子Mから直接出力され、端子Cが
HIGHのときそれ以前に端子Mから出力されていた信
号が保持される動きを有する。第2の記憶手段303
は、図5に示した回路で構成される。図5内に記載され
ている第5の記憶手段501及び502は、図4内に記
載されている第5の記憶手段401と同じ動作をする。
半加算器302の実施例は、図6に示した通りである。
FIG. 3 is a diagram showing an embodiment of the program counter 110 shown in FIG. The program counter 110 is composed of 10 blocks when the first storage unit 301, the half adder 302, and the second storage unit 303 are considered as one block. The first storage unit 301 is composed of the circuit shown in FIG. In the fifth storage unit 401 shown in FIG. 4, the terminal C is L
When OW, the terminals D and M are conductive, that is, the terminal D
The signal applied to the terminal M is directly output from the terminal M, and when the terminal C is HIGH, the signal output from the terminal M before that is held. Second storage means 303
Is composed of the circuit shown in FIG. The fifth storage means 501 and 502 described in FIG. 5 operate in the same manner as the fifth storage means 401 described in FIG.
An example of the half adder 302 is as shown in FIG.

【0012】図7は、図1内に記載されている命令レジ
スタ102の一実施例を示した図であり、16個の第5
の記憶手段701から構成されている。第5の記憶手段
701は、図4内に記載されている第5の記憶手段40
1と同じ動作をする。
FIG. 7 is a diagram showing one embodiment of the instruction register 102 shown in FIG.
The storage means 701 of FIG. The fifth storage means 701 is the fifth storage means 40 described in FIG.
Performs the same operation as 1.

【0013】図8は、図1内に記載されている番地一時
記憶手段104の一実施例を示した図であり、10個の
第2の記憶手段801から構成されている。第2の記憶
手段801は、図3内に記載の第2の記憶手段303と
同じ動作をする。
FIG. 8 is a diagram showing one embodiment of the address temporary storage means 104 shown in FIG. 1, and is composed of ten second storage means 801. The second storage unit 801 operates in the same manner as the second storage unit 303 shown in FIG.

【0014】図9は、図1内に記載されてる監視回路1
21の一実施例を示した図である。図9内のアップダウ
ン計数手段901は2ビットの2進カウンタであり、D
A端子が下位ビット、DB端子が上位ビットを出力す
る。第1の制御端子123は、アップダウン計数手段9
01のリセット端子であり、HIGHで、DA端子、D
B端子の出力をともにLOWとし、LOWでカウンタと
して動作させる。CU端子へクロックを入力すると、ア
ップダウン計数手段901はインクリメントされ、CD
端子へクロックを入力するとデクリメントされる。従っ
て監視回路121の機能としてみた場合、第2の制御端
子105の入力信号はプログラムカウンタ110から番
地一時記憶手段104へデータを転送する実行信号であ
り、また第3の制御端子116の入力信号は、番地一時
記憶手段104からプログラムカウンタ110へデータ
を戻す実行信号であるから、番地一時記憶手段104の
容量が1階層分だけであればDB端子がHIGHとなる
のは本来ありえない状態である事になり、よって該DB
端子をエラー発生出力端子122と見なすことができ
る。
FIG. 9 shows the monitoring circuit 1 described in FIG.
21 is a diagram showing an example of No. 21. FIG. The up / down counting means 901 in FIG. 9 is a 2-bit binary counter, and
The A terminal outputs the lower bits and the DB terminal outputs the upper bits. The first control terminal 123 is the up / down counting means 9
01 reset terminal, HIGH, DA terminal, D
Both outputs of the B terminals are LOW, and when LOW, they operate as a counter. When the clock is input to the CU terminal, the up / down counting means 901 is incremented and the CD
It is decremented when a clock is input to the pin. Therefore, in terms of the function of the monitoring circuit 121, the input signal of the second control terminal 105 is an execution signal for transferring data from the program counter 110 to the address temporary storage means 104, and the input signal of the third control terminal 116 is Since the execution signal is an execution signal for returning data from the address temporary storage means 104 to the program counter 110, if the capacity of the address temporary storage means 104 is only one layer, the DB terminal will not be HIGH at all. And therefore the DB
The terminal can be regarded as the error occurrence output terminal 122.

【0015】図1の実施例を説明するために、図10に
示した命令コードを定義し、図11に示したマイクロプ
ログラム0を例に各命令の動作について図12、図13
及び図14を用いて説明する。但し、図10内に記載の
OTHER#n命令の”#n”には数字が入り、対応す
るマイクロコードは、JMP命令、CALL命令、及び
RET命令とは競合しないコードとする。
In order to explain the embodiment of FIG. 1, the instruction code shown in FIG. 10 is defined, and the operation of each instruction will be described with reference to the microprogram 0 shown in FIG. 11 as an example.
And FIG. 14 will be described. However, "#n" of the OTHER #n instruction described in FIG. 10 is a number, and the corresponding microcode is a code that does not conflict with the JMP instruction, the CALL instruction, and the RET instruction.

【0016】図12はOTHER#n命令を実行させた
時のタイミング図である。時刻T0から動作の説明をす
る。
FIG. 12 is a timing chart when the OTHER #n instruction is executed. The operation will be described from time T0.

【0017】本事例において第4、第5及び第3の制御
端子115、111及び116は、それぞれLOW、H
IGH及びLOWの状態にあり、プログラムカウンタ1
10は第6の制御端子112の立ち下がりによりメモリ
101の番地を1つインクリメントする。時刻T0〜T1
時、プログラムカウンタ110内の10個の第1の記憶
手段301(以下、第1の記憶手段群301といい、他
の記憶手段についても複数の記憶手段を示すときは、記
憶手段群という)はそれ以前に保持していた番地情報0
02Hを第6の制御端子112の立ちさがりでインクリ
メントして003Hと為し、新データ003Hを保持す
ると共にアドレス信号線群117(A0〜A9)へ出力す
る。メモリ101は、新番地情報003Hを受け、相当
する領域に格納されているOTHER1命令のマイクロ
コードである16進数データ0000H(以下、データ
0000Hという)をメモリ出力信号線群118(D0〜
D15)へ出力する。
In this example, the fourth, fifth and third control terminals 115, 111 and 116 are LOW and H, respectively.
Program counter 1 in IGH and LOW states
Numeral 10 increments the address of the memory 101 by one when the sixth control terminal 112 falls. Time T0 to T1
At this time, the ten first storage means 301 in the program counter 110 (hereinafter, referred to as the first storage means group 301, and when other storage means also indicate a plurality of storage means, are referred to as storage means group) Address information 0 held before that
02H is incremented at the rising edge of the sixth control terminal 112 to form 003H, and new data 003H is held and output to the address signal line group 117 (A0 to A9). The memory 101 receives the new address information 003H, and outputs hexadecimal data 0000H (hereinafter referred to as data 0000H), which is a microcode of the OTHER1 instruction stored in the corresponding area, to the memory output signal line group 118 (D0 to
Output to D15).

【0018】時刻T2時、第7の制御端子113の立ち
上がりにより、半加算器302のA端子へHIGHを与
える。半加算器302は、第1の記憶手段301に記憶
保持されているデータ(A0)と第7の制御端子113
から与えられたデータ”1”を加算し、その加算結果S
0を第2の記憶手段303のD端子へ、桁上げ結果S1
を上位ブロックの半加算器のA端子へ与える。半加算器
113の前記動作は、他の9ブロック内についても同様
であり、結果的に第1の記憶手段群301に記憶保持さ
れているデータに対して1をインクリメントしたデータ
を第2の記憶手段群303へ伝える。さらに、第7の制
御端子113の立ち上がりにより、第2の記憶手段群3
03のL端子はHIGHとなり、第2の記憶手段群30
3がデータ書き込み許可状態となる。
At time T2, the seventh control terminal 113 rises to apply HIGH to the A terminal of the half adder 302. The half adder 302 includes the data (A0) stored and held in the first storage unit 301 and the seventh control terminal 113.
The data "1" given from is added, and the addition result S
0 to the D terminal of the second storage means 303, and carry result S1
To the A terminal of the half adder of the upper block. The operation of the half adder 113 is the same in the other 9 blocks, and as a result, the data stored and held in the first storage unit group 301 is incremented by 1 to the second storage. Inform the means group 303. Furthermore, the rising of the seventh control terminal 113 causes the second storage means group 3
The L terminal of 03 becomes HIGH, and the second storage means group 30
3 is in the data write enable state.

【0019】時刻T3、T4時、第8の制御端子114の
立ち下がり、及び立ち上がり動作により、半加算器群3
02で003Hから004Hにインクリメントされたデ
ータは、第2の記憶手段群303のD端子を介して書き
込まれる。この時、第9の制御端子106も、第8の制
御端子114と同じタイミングで信号が入力されている
が、第2の制御端子105がLOW状態であるので、番
地一時記憶手段104へデータは書き込まれない。
At times T3 and T4, the half adder group 3 is driven by the falling and rising operations of the eighth control terminal 114.
The data incremented from 003H to 004H in 02 is written via the D terminal of the second storage unit group 303. At this time, a signal is also input to the ninth control terminal 106 at the same timing as the eighth control terminal 114, but since the second control terminal 105 is in the LOW state, no data is stored in the address temporary storage means 104. Not written.

【0020】時刻T6〜T7時、第10の制御端子103
により、命令レジスタ102には、メモリ101に保持
されている命令OTHER1に対応したマイクロコード
であるデータ0000Hが記憶される。制御信号発生回
路109は、第2の出力信号線群108を受け、メモリ
101から発行されたデータ0000Hを解読し、第4
の制御端子115のLOW状態、第5の制御端子111
のHIGH状態、及び第3の制御端子116のLOW状
態の各状態を継続させる。
At times T6 to T7, the tenth control terminal 103
As a result, the instruction register 102 stores the data 0000H which is a microcode corresponding to the instruction OTHER1 held in the memory 101. The control signal generating circuit 109 receives the second output signal line group 108, decodes the data 0000H issued from the memory 101, and outputs the fourth signal.
Control terminal 115 in the LOW state, the fifth control terminal 111
And the LOW state of the third control terminal 116 are continued.

【0021】時刻T8、T9、T10、T11、T12、T13、
T14、T15時の動作は、それぞれ、図12における時刻
T0、T1、T2、T3、T4、T5、T6、T7、と同じ動作
をする。
Times T8, T9, T10, T11, T12, T13,
The operations at T14 and T15 are the same as those at times T0, T1, T2, T3, T4, T5, T6 and T7 in FIG. 12, respectively.

【0022】図13はJMP命令を実行させた時のタイ
ミング図である。
FIG. 13 is a timing chart when the JMP instruction is executed.

【0023】時刻T16、T17、T18、T19、T20、T2
1、T22、T23時の動作は、それぞれ、図12における
時刻T0、T1、T2、T3、T4、T5、T6、T7と同じ動
作をする。但し、時刻T22時の制御信号発生回路109
は、第2の出力信号線群108からJMP命令を受け、
メモリ101から発行されたデータ0410Hを解読
し、第4の制御端子115をHIGH、第5の制御端子
111をLOW、第3の制御端子116をLOWの各状
態にし、第1の制御信号線群107から第1の記憶手段
群301へのデータ書き込みが許可される。またJMP
命令においては、第1の制御信号線群107には分岐先
のアドレス010Hがデータとして与えられている。
Times T16, T17, T18, T19, T20, T2
Operations at 1, T22, and T23 are the same as those at times T0, T1, T2, T3, T4, T5, T6, and T7 in FIG. 12, respectively. However, the control signal generation circuit 109 at time T22
Receives a JMP command from the second output signal line group 108,
The data 0410H issued from the memory 101 is decoded, the fourth control terminal 115 is set to HIGH, the fifth control terminal 111 is set to LOW, the third control terminal 116 is set to LOW, and the first control signal line group is set. Data writing from 107 to the first storage unit group 301 is permitted. Also JMP
In the instruction, the branch destination address 010H is given as data to the first control signal line group 107.

【0024】時刻T24、T25時、第6の制御端子112
の信号の変化により、第1の制御信号線群107から第
1の記憶手段群301へアドレス010Hが書き込ま
れ、よってアドレス信号線群117がアドレス005H
から010Hへ変化する。
At times T24 and T25, the sixth control terminal 112
The address 010H is written from the first control signal line group 107 to the first storage means group 301 due to the change of the signal of the signal No.
To 010H.

【0025】時刻T26、T27、T28、T29、T30、T31
時の動作は、それぞれ図12における時刻T2、T3、T
4、T5、T6、T7と同じ動作をする。これにより以後は
分岐先のアドレスの命令を処理することが可能となる。
Times T26, T27, T28, T29, T30, T31
The operation of time is time T2, T3, T in FIG.
4, same operation as T5, T6, T7. This makes it possible to process the instruction at the branch destination address thereafter.

【0026】図14はCALL命令を実行させた時のタ
イミング図である。
FIG. 14 is a timing chart when the CALL instruction is executed.

【0027】CALL命令ではプログラムカウンタ11
0の動作はJMP命令と同じであるが、時刻T42〜T45
時においてプログラムカウンタ110の計数データを番
地一時記憶手段104に送る動作が追加される。
In the CALL instruction, the program counter 11
The operation of 0 is the same as the JMP instruction, but from time T42 to T45.
At the time, an operation of sending the count data of the program counter 110 to the address temporary storage means 104 is added.

【0028】時刻T42時、制御信号発生回路109は、
データ0820Hの解読結果がCALL命令であること
を受けて第2の制御端子105をHIGHに変化させ、
番地一時記憶手段104内の第2の記憶手段801を入
力許可状態とする。
At time T42, the control signal generating circuit 109
In response to the result of decoding the data 0820H being the CALL instruction, the second control terminal 105 is changed to HIGH,
The second storage means 801 in the address temporary storage means 104 is set in the input permission state.

【0029】時刻T43、T44時、第9の制御端子106
の信号の変化により、第2の出力信号線群119上のデ
ータ012Hが番地一時記憶手段104へ書き込まれ、
第3の出力信号線群120が012Hへと値が確定す
る。それによりRET命令を行った時の戻りアドレスの
参照が可能となる。
At times T43 and T44, the ninth control terminal 106
The data 012H on the second output signal line group 119 is written in the address temporary storage means 104 due to the change in the signal of
The value of the third output signal line group 120 is fixed to 012H. As a result, it becomes possible to refer to the return address when the RET instruction is performed.

【0030】図15はRET命令を実行させた時のタイ
ミング図である。
FIG. 15 is a timing chart when the RET instruction is executed.

【0031】時刻T48〜T63時の動作は、次に追加説明
する時刻T54〜T57時以外は、図13における時刻T16
〜T31と同じ動作をする。
The operation from time T48 to T63 is time T16 in FIG. 13 except time T54 to T57 which will be additionally described below.
~ Same operation as T31.

【0032】時刻T54、T55時、制御信号発生回路10
9は、第2の出力信号線群108を受け、メモリ101
から発行されたデータ0C00Hを解読し、第4の制御
端子115はLOW、第5の制御端子111はLOW、
第3の制御端子116はHIGHとなるよう制御するこ
とにより、第3の出力信号線群120から第1の記憶手
段群301へのデータ書き込みが許可される。
At times T54 and T55, the control signal generation circuit 10
9 receives the second output signal line group 108 and receives the memory 101
The data 0C00H issued from is decoded, the fourth control terminal 115 is LOW, the fifth control terminal 111 is LOW,
By controlling the third control terminal 116 to be HIGH, data writing from the third output signal line group 120 to the first storage means group 301 is permitted.

【0033】時刻T56、T57時、第6の制御端子112
の信号の変化により、第3の出力信号線群120上のデ
ータ012Hが第1の記憶手段群301へ書き込まれ、
よってメモリ出力信号線群117が、アドレス021H
から012Hへ変化する。そのため以前実行したCAL
L命令の次のアドレスに戻ることが可能となる。
At times T56 and T57, the sixth control terminal 112
Data 012H on the third output signal line group 120 is written to the first storage means group 301 by the change of the signal of
Therefore, the memory output signal line group 117 changes the address 021H.
To 012H. Therefore, the CAL that was previously executed
It is possible to return to the address next to the L instruction.

【0034】次に図10で定義した命令コードを用い、
具体的なプログラミング例に基づいて図16、図17及
び図18を用いて説明する。
Next, using the instruction code defined in FIG. 10,
It will be described with reference to FIGS. 16, 17 and 18 based on a specific programming example.

【0035】図16は、図2に示した従来のデータ処理
装置でのプログラミング例である。プログラムカウンタ
110は、3FFHまでカウントした後、000Hへ戻
る。分岐命令が存在しないため、プログラム領域は、全
て使用することになる。
FIG. 16 shows an example of programming in the conventional data processing device shown in FIG. The program counter 110 counts up to 3FFH and then returns to 000H. Since there is no branch instruction, the entire program area will be used.

【0036】図17は、図2において、命令レジスタか
らの出力信号線群をプログラムカウンタへ接続し、JM
P命令を使用可能とするよう改造した時のプログラミン
グ例である。JMP命令が使用できることになったこと
によって、図15と同じ動作を21行で実現可能とな
る。
In FIG. 17, the output signal line group from the instruction register is connected to the program counter in FIG.
It is a programming example when it is modified so that the P instruction can be used. Since the JMP instruction can be used, the same operation as that of FIG. 15 can be realized in 21 lines.

【0037】図18は、図2において、命令レジスタか
らの出力信号線群をプログラムカウンタへ接続するのみ
ならず、さらに番地一時記憶手段を設けたデータ処理装
置を用いることによって、OTHER#n命令、JMP
命令のみならず、CALL命令、RET命令が使用可能
であり、また図16と同じ動作を17行で実現可能であ
ることを示している。しかしCALL命令で呼び出され
る一連の処理の中でさらにCALL命令を使用する事
は、番地一時記憶手段104の記憶容量の仕様次第で可
能であるが、制限が存在し、番地一時記憶手段の状態を
監視する必要が生ずる。
FIG. 18 shows that the OTHER #n instruction, by connecting the output signal line group from the instruction register to the program counter in FIG. JMP
Not only the instruction but also the CALL instruction and the RET instruction can be used, and the same operation as that in FIG. 16 can be realized in 17 lines. However, it is possible to use the CALL instruction further in the series of processes called by the CALL instruction, depending on the specifications of the storage capacity of the address temporary storage means 104, but there is a limitation and the state of the address temporary storage means is changed. The need arises to monitor.

【0038】そこで監視回路121の動作について説明
する。CALL命令が実行された場合、図14の時刻T
42において第2の制御端子105が立ち上がることによ
り、アップダウン計数手段901はインクリメント機能
をもつ状態となる。時刻T43、T44で第9の制御端子1
06へクロックが入力され、アップダウン計数手段90
1はインクリメントされ、サブルーチンコールのネステ
ィング数がカウントアップされる。CALL命令が実行
されたとき、それ以前にCALL命令が実行されていて
ネスティング数が1であった場合、アップダウン計数手
段901が2Hへカウントアップされ、エラー発生出力
端子122がLOWからHIGHへ変化し、よって監視
回路121はプログラム中にサブルーチンコールのネス
ティング数の制約を破るプログラミングミスがあったこ
とを知らしめる。RET命令が実行された場合、図15
の時刻T54において第3の制御端子116が立ち上がる
ことにより、アップダウン計数手段901はデクリメン
ト機能をもつ状態となる。時刻T59、T60で第9の制御
端子106へクロックが入力され、アップダウン計数手
段901はデクリメントされ、サブルーチンコールのネ
スティング数がカウントダウンされる。RET命令が実
行されたとき、それ以前にCALL命令が実行されてお
らずネスティング数が0であった場合、アップダウン計
数手段901が3Hへ変化し、エラー発生出力端子12
2がLOWからHIGHへ変化し、よって監視回路12
1はプログラム中にサブルーチンコールのネスティング
数の制約を破るプログラミングミスがあったことを知ら
しめる。JMP命令、OTHER#n命令が実行された
ときは、第2の制御端子105、第3の制御端子116
はともにLOW状態のままであるので、アップダウン計
数手段901は変化しない。結局アップダウン計数手段
は、マイクロプログラム中のサブルーチンコールのネス
ティング数をカウントしていることに相当する。エラー
発生出力端子は、アップダウン計数手段901の計数状
態が0H、1Hの時はLOW、2H、3Hの時はHIG
Hを出力する。
The operation of the monitor circuit 121 will be described. When the CALL instruction is executed, time T in FIG.
When the second control terminal 105 rises at 42, the up / down counting means 901 becomes a state having an increment function. 9th control terminal 1 at time T43, T44
A clock is input to 06, and up / down counting means 90
1 is incremented and the nesting number of the subroutine call is counted up. When the CALL instruction is executed and the nesting number is 1 when the CALL instruction is executed, the up / down counting means 901 counts up to 2H and the error occurrence output terminal 122 changes from LOW to HIGH. Therefore, the monitoring circuit 121 informs that there is a programming error in the program that violates the constraint of the nesting number of subroutine calls. When the RET instruction is executed, FIG.
As the third control terminal 116 rises at time T54, the up / down counting means 901 becomes in a state having a decrement function. At times T59 and T60, the clock is input to the ninth control terminal 106, the up / down counting means 901 is decremented, and the nesting number of the subroutine call is counted down. When the CALL instruction has not been executed and the nesting number is 0 when the RET instruction is executed, the up / down counting means 901 changes to 3H, and the error occurrence output terminal 12
2 changes from LOW to HIGH, so that the monitoring circuit 12
1 indicates that there was a programming mistake in the program that violates the constraint on the number of nesting of subroutine calls. When the JMP instruction and the OTHER #n instruction are executed, the second control terminal 105 and the third control terminal 116
Both remain in the LOW state, the up-down counting means 901 does not change. After all, the up / down counting means corresponds to counting the nesting number of subroutine calls in the microprogram. The error occurrence output terminal is LOW when the counting state of the up / down counting means 901 is 0H, 1H and HIG when the counting state is 2H, 3H.
Output H.

【0039】以上の実施例では、番地一時記憶手段が一
つの場合について説明したが、2つ以上の場合でも実現
可能であり、設けた番地一時記憶手段の数だけサブルー
チンコールのネスティングが可能となる。但し、監視回
路の内部回路もネスティング数に合わせた数のアップダ
ウン計数手段とデコーダが必要となる。図19に、番地
一時記憶手段を2つ用いたときの実施例を示す。
In the above embodiments, the case where the number of the address temporary storage means is one has been described, but it is also possible to realize the case of two or more, and the nesting of the subroutine call can be performed by the number of the provided address temporary storage means. . However, the internal circuit of the monitoring circuit also requires the number of up-down counting means and decoders corresponding to the nesting number. FIG. 19 shows an embodiment in which two address temporary storage means are used.

【0040】なお、メモリサイズは、1024ワード
X 16ビットに限らず、他のメモリサイズのデータ処
理装置についても実現可能である。
The memory size is 1024 words.
The present invention is not limited to X 16 bits, and can be realized for data processing devices of other memory sizes.

【0041】[0041]

【発明の効果】本発明によれば、命令レジスタの出力信
号線をプログラムカウンタへ接続したことにより分岐命
令が実現可能となり、その結果マイクロプログラムの長
さを短くすることができ、また、プログラムカウンタに
番地一時記憶手段を設けることにより、コール、リター
ン命令が実現可能となり、その結果同じ処理はサブルー
チン化できるためマイクロプログラムの長さを短くする
ことができ、もってメモリの物理的サイズを小さくでき
るという効果を有する。さらに監視回路を設けたことに
より、メモリに格納されたマイクロプログラムのサブル
ーチンコールのネスティング数を監視し、エラー発生出
力信号を外部へ出力できるため、サブルーチンコールの
ネスティング数の制約を破るプログラミングミスを外部
へ知らせてプログラム作成者の負担を軽減できるという
効果も有する。
According to the present invention, a branch instruction can be realized by connecting the output signal line of the instruction register to the program counter, and as a result, the length of the microprogram can be shortened and the program counter can be shortened. By providing the address temporary storage means at the address, the call and return instructions can be realized, and as a result, the same processing can be made into a subroutine, so that the length of the microprogram can be shortened, and thus the physical size of the memory can be reduced. Have an effect. Furthermore, by providing a monitoring circuit, the nesting number of subroutine calls of the microprogram stored in the memory can be monitored and the error occurrence output signal can be output to the outside, so programming errors that violate the nesting number of subroutine calls can be prevented. It also has the effect of reducing the burden on the program creator by informing the user.

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

【図1】 本発明の一実施例を示した図である。FIG. 1 is a diagram showing an embodiment of the present invention.

【図2】 従来のデータ処理装置を示した図である。FIG. 2 is a diagram showing a conventional data processing device.

【図3】 図1内に記載されている番地計数手段の一実
施例を示した図である。
FIG. 3 is a diagram showing an embodiment of an address counting means shown in FIG.

【図4】 図3内に記載されている第1の記憶手段の一
実施例を示した図である。
FIG. 4 is a diagram showing an example of a first storage unit shown in FIG.

【図5】 図3内に記載されている第2の記憶手段、及
び図8内に記載されている第2の記憶手段の一実施例を
示した図である。
5 is a diagram showing an embodiment of a second storage means shown in FIG. 3 and a second storage means shown in FIG. 8. FIG.

【図6】 図3内に記載されている半加算器の一実施例
を示した図である。
FIG. 6 is a diagram showing an example of a half adder described in FIG. 3;

【図7】 図1内に記載されている命令格納手段の一実
施例を示した図である。
FIG. 7 is a diagram showing an embodiment of an instruction storage unit shown in FIG.

【図8】 図1内に記載されている番地一時記憶手段の
一実施例を示した図である。
FIG. 8 is a diagram showing an embodiment of an address temporary storage means shown in FIG.

【図9】 図1内に記載されている監視回路の一実施例
を示した図である。
FIG. 9 is a diagram showing an embodiment of the monitoring circuit shown in FIG. 1.

【図10】 図1のハードウェア上で定義可能な命令コ
ード例を示した図である。
10 is a diagram showing an example of instruction codes that can be defined on the hardware of FIG.

【図11】 図10で定義した命令コードの動作説明を
するためのマイクロプログラム例を示した図である。
11 is a diagram showing an example of a micro program for explaining the operation of the instruction code defined in FIG.

【図12】 図10で定義したOTHER#n命令実行
時の、各信号のタイミングを示した図である。
12 is a diagram showing the timing of each signal when the OTHER # n instruction defined in FIG. 10 is executed.

【図13】 図10で定義したJMP命令実行時の、各
信号のタイミングを示した図である。
13 is a diagram showing the timing of each signal when the JMP instruction defined in FIG. 10 is executed.

【図14】 図10で定義したCALL命令実行時の、
各信号のタイミングを示した図である。
14 is a diagram illustrating the execution of the CALL instruction defined in FIG.
It is the figure which showed the timing of each signal.

【図15】 図10で定義したRET命令実行時の、各
信号のタイミングを示した図である。
FIG. 15 is a diagram showing the timing of each signal when the RET instruction defined in FIG. 10 is executed.

【図16】 OTHER#n命令のみで作成されたマイ
クロプログラム例を示した図である。
FIG. 16 is a diagram showing an example of a microprogram created only by an OTHER #n instruction.

【図17】 OTHER#n命令とJMP命令で作成さ
れたマイクロプログラム例を示した図である。
FIG. 17 is a diagram showing an example of a microprogram created by an OTHER #n instruction and a JMP instruction.

【図18】 OTHER#n命令、JMP命令、CAL
L命令、及びRET命令で作成されたマイクロプログラ
ム例を示した図である。
FIG. 18: OTHER #n instruction, JMP instruction, CAL
FIG. 9 is a diagram showing an example of a microprogram created by an L instruction and a RET instruction.

【図19】 本発明の他の実施例を示した図である。FIG. 19 is a diagram showing another embodiment of the present invention.

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

101 命令情報記憶手段 102 命令格納手段 103 第10の制御端子 104 番地一時記憶手段 105 第2の制御端子 106 第9の制御端子 107 第1の制御信号線群 108 第2の制御信号線群 109 制御信号発生回路 110 番地計数手段 111 第5の制御端子 112 第6の制御端子 113 第7の制御端子 114 第8の制御端子 115 第4の制御端子 116 第3の制御端子 117 アドレス信号線群 118 第1の出力信号線群 119 第2の出力信号線群 120 第3の出力信号線群 121 監視回路 122 エラー発生出力端子 123 第1の制御端子 301 第1の記憶手段 302 半加算器 303、801 第2の記憶手段 401、501、502、701 第5の記憶手段 402、403、404、503、602、902、9
03 2入力論理積回路 405 3入力論理積回路 504、904 インバータ回路 601 排他的論理和回路 901 アップダウン計数手段
101 command information storage means 102 command storage means 103 tenth control terminal 104 address temporary storage means 105 second control terminal 106 ninth control terminal 107 first control signal line group 108 second control signal line group 109 control Signal generating circuit 110 Address counting means 111 Fifth control terminal 112 Sixth control terminal 113 Seventh control terminal 114 Eighth control terminal 115 Fourth control terminal 116 Third control terminal 117 Address signal line group 118th 1 output signal line group 119 2nd output signal line group 120 3rd output signal line group 121 monitoring circuit 122 error occurrence output terminal 123 1st control terminal 301 1st storage means 302 half adder 303, 801 Second storage means 401, 501, 502, 701 Fifth storage means 402, 403, 404, 503, 602, 02,9
03 2-input AND circuit 405 3-input AND circuit 504, 904 Inverter circuit 601 Exclusive OR circuit 901 Up-down counting means

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 命令情報が格納された命令情報記憶手段
と、該命令情報を受け記憶保持する命令格納手段と、該
命令格納手段の出力データに応じ制御信号群を発生する
制御信号発生回路と、該制御信号発生回路の出力信号を
基準クロックとして受け該基準クロックを計数し該命令
情報記憶手段の番地を決定する番地計数手段とにより構
成されるデータ処理装置において、該命令格納手段の出
力信号の一部を該番地計数手段へ転送する経路を設けた
ことを特徴とするデータ処理装置。
1. A command information storage means for storing command information, a command storage means for receiving and storing the command information, and a control signal generation circuit for generating a control signal group according to output data of the command storage means. An output signal of the instruction storage means in a data processing device configured to receive an output signal of the control signal generation circuit as a reference clock and count the reference clock to determine an address of the instruction information storage means. And a path for transferring a part of the data to the address counting means.
【請求項2】 請求項1に記載のデータ処理装置におい
て、前記命令格納手段の任意の命令情報に応じた前記制
御信号発生回路からの制御信号により制御される少なく
とも1つの番地一時記憶手段を設けたことを特徴するデ
ータ処理装置。
2. The data processing device according to claim 1, further comprising at least one address temporary storage means controlled by a control signal from said control signal generation circuit according to arbitrary instruction information of said instruction storage means. A data processing device characterized by the above.
【請求項3】 請求項1に記載のデータ処理装置におい
て、前記命令格納手段の任意の命令情報に応じた前記制
御信号発生回路からの制御信号により制御される監視回
路付き番地一時記憶手段を設けたことを特徴とするデー
タ処理装置。
3. The data processing device according to claim 1, further comprising: an address temporary storage means with a monitoring circuit, which is controlled by a control signal from the control signal generation circuit according to arbitrary instruction information of the instruction storage means. A data processing device characterized by the above.
JP17181093A 1993-07-12 1993-07-12 Data processor Pending JPH0728644A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17181093A JPH0728644A (en) 1993-07-12 1993-07-12 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17181093A JPH0728644A (en) 1993-07-12 1993-07-12 Data processor

Publications (1)

Publication Number Publication Date
JPH0728644A true JPH0728644A (en) 1995-01-31

Family

ID=15930152

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17181093A Pending JPH0728644A (en) 1993-07-12 1993-07-12 Data processor

Country Status (1)

Country Link
JP (1) JPH0728644A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7831809B2 (en) 2005-09-23 2010-11-09 Samsung Electronics Co., Ltd. Method for reducing code size of a program in code memory by dynamically storing an instruction into a memory location following a group of instructions indicated by an offset operand and either a length operand or a bitmask operand of an echo instruction
JP2012123810A (en) * 2005-02-18 2012-06-28 Qualcomm Inc Method and apparatus for managing return stack

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012123810A (en) * 2005-02-18 2012-06-28 Qualcomm Inc Method and apparatus for managing return stack
US7831809B2 (en) 2005-09-23 2010-11-09 Samsung Electronics Co., Ltd. Method for reducing code size of a program in code memory by dynamically storing an instruction into a memory location following a group of instructions indicated by an offset operand and either a length operand or a bitmask operand of an echo instruction

Similar Documents

Publication Publication Date Title
US3872447A (en) Computer control system using microprogramming and static/dynamic extension of control functions thru hardwired logic matrix
US4409654A (en) Data processor adapted for interruption to an instruction stream
KR900003591B1 (en) Data processor devices
US4446517A (en) Microprogram memory with page addressing and address decode in memory
JPH11184750A (en) Data processor having variable length code processing mechanism
US3602889A (en) Extended addressing for programmed data processor having improved register loading means
US20060004980A1 (en) Address creator and arithmetic circuit
JPH0769791B2 (en) Microprocessor
US5046040A (en) Microprogram control apparatus using don't care bits as part of address bits for common instructions and generating variable control bits
JPH01239639A (en) Circuit apparatus and control for instruction buffer memory in data processor
US5696957A (en) Integrated circuit comprising a central processing unit for executing a plurality of programs
US3566366A (en) Selective execution circuit for program controlled data processors
US4661925A (en) Computer control memory apparatus providing variable microinstruction length
EP0107952A2 (en) Information processing apparatus and its instruction control system
US5938758A (en) Microprocessor having function of prefetching instruction
EP0361497A2 (en) Program/data memory employed in microcomputer system
KR930009754B1 (en) Microcomputer
JPH0728644A (en) Data processor
EP0374830A2 (en) Control store address generator for developing unique instruction execution starting address
JPH07262162A (en) Microprocessor
US3644900A (en) Data-processing device
US5604876A (en) Apparatus for handling differing data length instructions using either directly specified or indirectly specified data lengths
US3761893A (en) Digital computer
US5050076A (en) Prefetching queue control system
US4574347A (en) Data processing apparatus for performing high-speed arithmetic operations