JPH08305564A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH08305564A
JPH08305564A JP10541595A JP10541595A JPH08305564A JP H08305564 A JPH08305564 A JP H08305564A JP 10541595 A JP10541595 A JP 10541595A JP 10541595 A JP10541595 A JP 10541595A JP H08305564 A JPH08305564 A JP H08305564A
Authority
JP
Japan
Prior art keywords
data
logic unit
memory
input
temporary save
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
JP10541595A
Other languages
Japanese (ja)
Inventor
Susumu Yamada
進 山田
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric 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
Application filed by Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP10541595A priority Critical patent/JPH08305564A/en
Publication of JPH08305564A publication Critical patent/JPH08305564A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE: To provide the microcomputer in which a transition time to a program processing based on an interrupt request can be reduced. CONSTITUTION: Data subject to be operated stored in a stack memory 10 are directly fed to one input of an arithmetic logic unit 13 and other arithmetic data latched by a latch circuit 11 are directly fed to the other input of the arithmetic logic unit 13 and an arithmetic output of the arithmetic logic unit 13 is stored in a register 14. Thus, even on the occurrence of an interruption request, only the content of the register 14 has only to be saved tentatively in th stack memory 10 and the time to be transited to the interrupt processing can be reduced.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、割り込み処理を効率よ
く実行するのに好適なマイクロコンピュータの構成に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer configuration suitable for efficiently executing interrupt processing.

【0002】[0002]

【従来の技術】図2は、従来のマイクロコンピュータの
構成を示す図である。図2において、(1)はROMで
あり、該ROM(1)の記憶領域に割り振られた複数の
アドレスに、マイクロコンピュータの動作を制御する為
の複数のプログラムデータDATAが事前に記憶された
ものである。(2)は制御回路であり、各場合に応じた
前記ROM(1)のアドレスをアクセスするアドレスデ
ータADDを出力し、該アドレスデータADDに対応す
る前記ROM(1)のアドレスから読み出されたプログ
ラムデータDATAを取り込んで解読し、この解読結果
に基づきマイクロコンピュータの動作制御を行うもので
ある。(3)(4)は各々nビットのレジスタであり、
制御回路(2)の制御出力により、データの保持動作を
行える状態に制御される。例えば、レジスタ(3)及び
レジスタ(4)には、各々所定の計数値となっているカ
ウンタCTR1及びCTR2のnビットデータがデータ
バス(5)を介して保持されるものとする。尚、レジス
タ(3)(4)にセットされるデータは前記カウンタC
TR1及びCTR2の計数値に限定されず、演算を行い
たい2種類のnビットデータを入力ポート(図示せず)
を介してマイクロコンピュータ内部に取り込み、前記2
種類のnビットデータをデータバス(5)を介してレジ
スタ(3)(4)に保持したりしてもよく、即ちレジス
タ(3)(4)へのセットが可能であれば如何なるデー
タであっても対象となる。(6)は演算論理ユニットで
あり、レジスタ(3)(4)に保持された各nビットデ
ータに対して所定の論理演算(加算、減算等)を行い、
この結果得られたnビットデータを再び一方のレジスタ
(3)に保持させるものである。
2. Description of the Related Art FIG. 2 is a diagram showing a configuration of a conventional microcomputer. In FIG. 2, (1) is a ROM, and a plurality of program data DATA for controlling the operation of the microcomputer are stored in advance at a plurality of addresses allocated to the storage area of the ROM (1). Is. Reference numeral (2) is a control circuit, which outputs address data ADD for accessing the address of the ROM (1) corresponding to each case, and is read from the address of the ROM (1) corresponding to the address data ADD. The program data DATA is fetched and decoded, and the operation of the microcomputer is controlled based on the decoding result. (3) and (4) are n-bit registers,
The control output of the control circuit (2) controls the data holding operation. For example, it is assumed that the register (3) and the register (4) hold n-bit data of the counters CTR1 and CTR2, each of which has a predetermined count value, via the data bus (5). The data set in the registers (3) and (4) is the counter C.
Not limited to the count values of TR1 and CTR2, but two types of n-bit data to be operated are input ports (not shown)
Via the computer to the inside of the microcomputer,
The n-bit data of a kind may be held in the registers (3) and (4) via the data bus (5), that is, any data can be set in the registers (3) and (4). Even the target. (6) is an arithmetic logic unit, which performs a predetermined logical operation (addition, subtraction, etc.) on each n-bit data held in the registers (3) and (4),
The n-bit data obtained as a result is held in one register (3) again.

【0003】マイクロコンピュータは一般に上記の如く
構成されているが、ここで、レジスタ(3)(4)の内
容に論理演算を施すメインプログラムの実行中に、何ら
かの要因により割り込み要求が発生した場合、前記メイ
ンプログラムの実行に代わり前記割り込み要求に基づく
サブルーチンプログラムを実行しなければならない。そ
の為に、前記メインプログラムは実行された時点までの
状態で処理を一旦中断され、前記サブルーチンプログラ
ムが終了するまで前記メインプログラムに基づく処理デ
ータを一時待避させておく必要がある。具体的には、ス
タックメモリ(7)が設けられており、前記割り込み要
求が発生すると、スタックメモリ(7)が制御回路
(2)の制御信号で制御され、スタックメモリ(7)の
スタック領域STACK1及びSTACK2に各々メイ
ンプログラム中断時におけるレジスタ(3)(4)の値
がデータバス(5)を介して一時待避される。こうし
て、レジスタ(3)(4)及び演算論理ユニット(6)
を用いてサブルーチン処理が実行可能となる。尚、サブ
ルーチン処理は、制御回路(2)が割り込み要求により
特定されるROM(1)のアドレスをアクセスし、即ち
メインプログラム実行時のアドレスからサブルーチンプ
ログラム処理を行うアドレスにジャンプすることにより
実行される。
The microcomputer is generally constructed as described above. Here, if an interrupt request occurs due to some factor during the execution of the main program for performing a logical operation on the contents of the registers (3) and (4), Instead of executing the main program, a subroutine program based on the interrupt request must be executed. Therefore, it is necessary to suspend the processing of the main program until it is executed, and temporarily save the processing data based on the main program until the subroutine program ends. Specifically, a stack memory (7) is provided, and when the interrupt request occurs, the stack memory (7) is controlled by the control signal of the control circuit (2), and the stack area STACK1 of the stack memory (7) is controlled. In STACK2 and STACK2, the values of the registers (3) and (4) at the time of interruption of the main program are temporarily saved via the data bus (5). Thus, the registers (3) (4) and the arithmetic logic unit (6)
Subroutine processing can be executed using. The subroutine processing is executed by the control circuit (2) accessing the address of the ROM (1) specified by the interrupt request, that is, jumping from the address at the time of executing the main program to the address at which the subroutine program processing is performed. .

【0004】[0004]

【発明が解決しようとする課題】しかしながら、割り込
み要求に基づくメインプログラムからサブルーチンプロ
グラムへの移行時に、レジスタ(3)(4)の両方の内
容をスタックメモリ(7)のスタック領域に一時待避さ
せる必要がある為、一時待避に時間がかかり、その結
果、割り込み処理時間が長くなる問題があった。
However, it is necessary to temporarily save the contents of both the registers (3) and (4) in the stack area of the stack memory (7) at the time of transition from the main program to the subroutine program based on the interrupt request. Therefore, there is a problem that it takes a long time to temporarily save, and as a result, the interrupt processing time becomes long.

【0005】そこで、本発明は、割り込み要求に基づく
プログラム処理への移行時間を短縮できるマイクロコン
ピュータを提供することを目的とする。
Therefore, an object of the present invention is to provide a microcomputer capable of shortening the transition time to program processing based on an interrupt request.

【0006】[0006]

【課題を解決するための手段】本発明は、前記問題点を
解決する為に成されたものであり、その特徴とするとこ
ろは、プログラム命令に従って2つの被演算データに所
定の演算を施すマイクロコンピュータにおいて、前記2
つの被演算データがスタックされる一時待避メモリと、
前記一時待避メモリから先に読み出された一方の前記被
演算データをラッチするラッチ回路と、一方の入力に前
記ラッチ回路に保持された一方の前記被演算データが印
加されると共に他方の入力に前記一時待避メモリから読
み出された他方の前記被演算データが印加され、両方の
被演算データに対して所定の演算を施す演算論理ユニッ
トと、前記演算論理ユニットの演算結果を保持するレジ
スタと、を備え、割り込み要求発生時、前記レジスタの
保持内容のみを前記一時待避メモリに一時待避させ、前
記割り込み要求に基づくプログラム処理を実行可能とし
た点である。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems, and is characterized in that a micro-processor for performing a predetermined operation on two operand data according to a program instruction. In the computer, the above 2
A temporary save memory where two operands are stacked,
A latch circuit for latching one of the operated data previously read from the temporary save memory, and one of the operated data held in the latch circuit is applied to one input and the other input is applied to the other input. An arithmetic logic unit to which the other of the operand data read from the temporary save memory is applied and which performs a predetermined arithmetic operation on both operand data; and a register for holding the arithmetic result of the arithmetic logic unit, When an interrupt request is generated, only the contents held in the register are temporarily saved in the temporary save memory, and the program processing based on the interrupt request can be executed.

【0007】[0007]

【作用】本発明によれば、演算論理ユニットの一方の入
力には、一時待避メモリに保持された一方の被演算デー
タが印加され、前記演算論理ユニットの他方の入力に
は、ラッチ回路に保持された他方の被演算データが印加
され、演算論理ユニットの演算出力がレジスタに保持さ
れる構成とした。従って、割り込み要求が発生したとし
ても、レジスタの内容のみを一時待避メモリに一時待避
させるだけで済み、割り込み処理に移行する際の時間を
短縮できる。
According to the present invention, one input of the operation logic unit held in the temporary save memory is applied to one input of the operation logic unit, and the other input of the operation logic unit is held in the latch circuit. The other processed data is applied and the operation output of the operation logic unit is held in the register. Therefore, even if an interrupt request occurs, only the contents of the register need only be temporarily saved in the temporary save memory, and the time required to shift to interrupt processing can be shortened.

【0008】[0008]

【実施例】本発明の詳細を図面に従って具体的に説明す
る。図1は本発明のマイクロコンピュータの構成を示す
図である。図1において、(8)はROM(メモリ)で
あり、マイクロコンピュータをメインルーチン又はサブ
ルーチンで動作させる為の複数のプログラム命令が記憶
されている。(9)は制御回路であり、ROM(8)と
制御回路(9)との間では、制御回路(9)からアドレ
スデータADDが出力されると、ROM(8)の該当す
るアドレスがアクセスされ、ROM(9)の該当アドレ
スから読み出されたプログラムデータDATAが制御回
路(9)で解読され、この解読結果に基づきマイクロコ
ンピュータの動作が制御される。(10)はスタックメ
モリ(一時待避メモリ)であり、後述する演算論理ユニ
ットで演算されるべき2種類の被演算データを各々スタ
ック領域STACK1及びSTACK2に保持させる機
能を有している。該スタックメモリ(10)は、制御回
路(9)の制御出力で一時待避動作を制御され、メイン
プログラムを中断した直後のアドレス情報がスタック領
域の所定の階層に一時待避される機能も有している。こ
のアドレス情報は、サブルーチンからメインプログラム
に復帰する時に再び制御回路(2)側に取り込まれる。
(11)はnビット構成のラッチ回路であり、後述する
演算論理ユニットで演算されるべく、スタックメモリ
(10)のスタック領域STACK2から先に読み出さ
れた一方の被演算データをラッチするものである。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. FIG. 1 is a diagram showing the configuration of the microcomputer of the present invention. In FIG. 1, (8) is a ROM (memory) in which a plurality of program instructions for operating the microcomputer in a main routine or a subroutine are stored. Reference numeral (9) is a control circuit. When the address data ADD is output from the control circuit (9) between the ROM (8) and the control circuit (9), the corresponding address of the ROM (8) is accessed. , The program data DATA read from the corresponding address of the ROM (9) is decoded by the control circuit (9), and the operation of the microcomputer is controlled based on the decoding result. Reference numeral (10) is a stack memory (temporary save memory), which has a function of holding two types of processed data to be operated by an operation logic unit described later in the stack areas STACK1 and STACK2, respectively. The stack memory (10) has a function of temporarily saving the address information immediately after the main program is interrupted, whose temporary saving operation is controlled by the control output of the control circuit (9). There is. This address information is taken into the control circuit (2) side again when returning from the subroutine to the main program.
Reference numeral (11) is an n-bit configuration latch circuit, which latches one of the operand data previously read from the stack area STACK2 of the stack memory (10) so as to be operated by an arithmetic logic unit described later. is there.

【0009】ここで、スタックメモリ(10)のスタッ
ク領域STACK1及びSTACK2には、各々所定の
計数値となっているカウンタCTR1及びCTR2のn
ビットデータがデータバス(12)を介して保持される
ものとする。尚、両スタック領域に保持されるデータは
前記カウンタCTR1及びCTR2の計数値に限定され
ず、演算を行いたい2種類のnビットデータを入力ポー
ト(図示せず)を介してマイクロコンピュータ内部に取
り込み、前記2種類のnビットデータをデータバス(1
2)を介して両スタック領域に保持したりしてもよく、
即ち両スタック領域への待避が可能であれば如何なるデ
ータであっても対象とできる。
Here, in the stack areas STACK1 and STACK2 of the stack memory (10), n of the counters CTR1 and CTR2 each having a predetermined count value.
Bit data shall be held via the data bus (12). The data held in both stack areas is not limited to the count values of the counters CTR1 and CTR2, and two types of n-bit data to be operated are fetched into the microcomputer via an input port (not shown). , The two types of n-bit data are transferred to the data bus (1
It may be held in both stack areas via 2),
That is, any data can be used as long as it can save to both stack areas.

【0010】(13)は前述した演算論理ユニットであ
り、一方の入力はラッチ回路(11)の出力と直接接続
され、他方の入力はスタックメモリ(10)と直接接続
されている。そして、演算論理ユニット(13)で両方
の被演算データに対して所定の演算が施される。(1
4)はnビット構成のレジスタであり、演算論理ユニッ
ト(13)が両方の被演算データに対して行ったnビッ
トの演算結果(加算、減算等)を保持するものである。
(13) is the above-mentioned arithmetic logic unit, one input of which is directly connected to the output of the latch circuit (11) and the other input of which is directly connected to the stack memory (10). Then, the arithmetic logic unit (13) performs a predetermined arithmetic operation on both operand data. (1
Reference numeral 4) is a register having an n-bit configuration, which holds an n-bit operation result (addition, subtraction, etc.) performed by the operation logic unit (13) on both operand data.

【0011】以上の如く構成されたマイクロコンピュー
タにおいて、メインプログラムの実行中、特に演算論理
ユニット(13)で2種類の被演算データに対して演算
処理を行うプログラムの実行中に、何らかの要因により
割り込み要求が発生した場合、演算結果が保持された1
個のレジスタ(14)の値のみをスタックメモリ(1
0)に一時待避させ、メインプログラムを一旦中断して
割り込み要求に基づくサブルーチン処理の実行に移行で
きる。
In the microcomputer configured as described above, an interrupt is caused by some factor during execution of the main program, especially during execution of a program for performing arithmetic processing on two types of operand data in the arithmetic logic unit (13). If a request occurs, the operation result is held 1
Only the values of the registers (14) are stored in the stack memory (1
0), the main program is temporarily interrupted, and execution of subroutine processing based on an interrupt request can be performed.

【0012】尚、割り込み要求に基づくサブルーチン処
理が何重にも重なった場合でも、レジスタ(14)の値
のみをスタックメモリ(10)に一時待避するだけで済
み、各サブルーチン処理を従来に比べて速く実行でき
る。
Even if the subroutine processing based on the interrupt request is repeated many times, only the value of the register (14) needs to be temporarily saved in the stack memory (10), and each subroutine processing is different from the conventional one. It can run fast.

【0013】[0013]

【発明の効果】本発明によれば、所定のプログラムの実
行中に、割り込み要求が発生した場合でも、演算論理ユ
ニットの演算結果を保持した1個のレジスタの値のみを
一時待避メモリに待避させるだけで済み、割り込み要求
に基づくプログラム処理への移行時間を短縮できる利点
が得られる。
According to the present invention, even if an interrupt request occurs during execution of a predetermined program, only the value of one register holding the operation result of the operation logic unit is saved in the temporary save memory. This is sufficient, and there is an advantage that the transition time to the program processing based on the interrupt request can be shortened.

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

【図1】本発明のマイクロコンピュータの構成を示す図
である。
FIG. 1 is a diagram showing a configuration of a microcomputer of the present invention.

【図2】従来のマイクロコンピュータの構成を示す図で
ある。
FIG. 2 is a diagram showing a configuration of a conventional microcomputer.

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

(10) スタックメモリ (13) 演算論理ユニット (14) レジスタ (10) Stack memory (13) Arithmetic logic unit (14) Register

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 プログラム命令に従って2つの被演算デ
ータに所定の演算を施すマイクロコンピュータにおい
て、 前記2つの被演算データがスタックされる一時待避メモ
リと、 前記一時待避メモリから先に読み出された一方の前記被
演算データをラッチするラッチ回路と、 一方の入力に前記ラッチ回路に保持された一方の前記被
演算データが印加されると共に他方の入力に前記一時待
避メモリから読み出された他方の前記被演算データが印
加され、両方の被演算データに対して所定の演算を施す
演算論理ユニットと、 前記演算論理ユニットの演算結果を保持するレジスタ
と、を備え、 割り込み要求発生時、前記レジスタの保持内容のみを前
記一時待避メモリに一時待避させ、前記割り込み要求に
基づくプログラム処理を実行可能としたことを特徴とす
るマイクロコンピュータ。
1. A microcomputer for performing a predetermined operation on two operand data in accordance with a program instruction, wherein a temporary save memory in which the two operand data are stacked, and one of the temporary save memories that have been previously read from the temporary save memory. And a latch circuit for latching the operated data, and one of the operated data held in the latch circuit is applied to one input and the other input read from the temporary save memory to the other input. An arithmetic logic unit that receives the operation data and applies a predetermined operation to both the operation data and a register that holds the operation result of the operation logic unit are provided. Only the contents are temporarily saved in the temporary save memory, and the program processing based on the interrupt request can be executed. Micro-computer which is characterized.
【請求項2】 プログラム命令を記憶したメモリをアク
セスし該メモリから読み出されたプログラム命令を解読
する制御回路を備え、前記プログラム命令の解読結果に
基づき、前記制御回路と前記一時待避メモリとの間でデ
ータの授受を可能としたことを特徴とする請求項1記載
のマイクロコンピュータ。
2. A control circuit for accessing a memory storing a program command and decoding the program command read from the memory, wherein the control circuit and the temporary save memory are based on a decoding result of the program command. The microcomputer according to claim 1, wherein data can be exchanged between them.
JP10541595A 1995-04-28 1995-04-28 Microcomputer Pending JPH08305564A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10541595A JPH08305564A (en) 1995-04-28 1995-04-28 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10541595A JPH08305564A (en) 1995-04-28 1995-04-28 Microcomputer

Publications (1)

Publication Number Publication Date
JPH08305564A true JPH08305564A (en) 1996-11-22

Family

ID=14406982

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10541595A Pending JPH08305564A (en) 1995-04-28 1995-04-28 Microcomputer

Country Status (1)

Country Link
JP (1) JPH08305564A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100368197B1 (en) * 1994-09-09 2003-04-10 가부시끼가이샤 히다치 세이사꾸쇼 Data processing device
JP2014161002A (en) * 2012-06-01 2014-09-04 Semiconductor Energy Lab Co Ltd Semiconductor device and processing device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100368197B1 (en) * 1994-09-09 2003-04-10 가부시끼가이샤 히다치 세이사꾸쇼 Data processing device
JP2014161002A (en) * 2012-06-01 2014-09-04 Semiconductor Energy Lab Co Ltd Semiconductor device and processing device

Similar Documents

Publication Publication Date Title
US4924382A (en) Debugging microprocessor capable of switching between emulation and monitor without accessing stack area
US4274138A (en) Stored program control system with switching between instruction word systems
US4542456A (en) Method and apparatus for performing range checks
JP3781519B2 (en) Instruction control mechanism of processor
US5410721A (en) System and method for incrementing a program counter
US5757685A (en) Data processing system capable of processing long word data
US5367648A (en) General purpose memory access scheme using register-indirect mode
JPH08305564A (en) Microcomputer
KR910001708B1 (en) Central processing unit
JP2520882B2 (en) Data processing device and data processing method
JP3239042B2 (en) Microcomputer
US6233675B1 (en) Facility to allow fast execution of and, or, and test instructions
JPH0612107A (en) Sequence arithmetic processor and sequence arithmetic processing unit
JPH08305587A (en) Microcomputer
JPH08305588A (en) Microcomputer
JP3520372B2 (en) Elimination of critical path in operation of memory control unit and input / output control unit
JPH0222413B2 (en)
JP2607319B2 (en) Programmable controller
JPH04280334A (en) One chip microcomputer
JPS59218569A (en) Microcomputer
JP2883488B2 (en) Instruction processing unit
US6289439B1 (en) Method, device and microprocessor for performing an XOR clear without executing an XOR instruction
JPH05282133A (en) Arithmetic system
JP2000029508A (en) Programmable controller
JPS623345A (en) Interruption system