JPH0351973A - Microcomputer - Google Patents
MicrocomputerInfo
- Publication number
- JPH0351973A JPH0351973A JP1186788A JP18678889A JPH0351973A JP H0351973 A JPH0351973 A JP H0351973A JP 1186788 A JP1186788 A JP 1186788A JP 18678889 A JP18678889 A JP 18678889A JP H0351973 A JPH0351973 A JP H0351973A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- accumulator
- mode
- output
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Microcomputers (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
【発明の詳細な説明】
(イ〉産業上の利用分野
この発明はアキュムレータを使用する演算,転送モード
とメモリを使用する演算,転送モードの2モードを備え
るマイクロコンピュータに関する.
(口)従来の技術
マイクロコンピュータはレジスタ構成によりアキュムレ
ータ方式、汎用レジスタ方式、メモリ方式に分類される
。アキュムレータ方式は命令形式が簡単となる利点があ
り、4〜8ビットのマイクロコンピュータの殆どがこれ
に属している。汎用レジスタ方式はアキュムレータを備
えず、演算,転送,アドレス計算用の汎用レジスタを備
え、2アドレス方式でデータ処理を行う方式であり、自
由度が高いため、16ビットマイクロコンピュータに多
く採用されている。また、メモリ方式はレジスタが全て
メモリ上にマップされており、演算はメモリ間で行われ
る。そこで、上記した各方式の利点を利用するため、近
年ではアキュムレータ方式の命令セットとメモリ方式の
命令セットの両方を備えるマイクロフンビュータが提供
されるようになっている。DETAILED DESCRIPTION OF THE INVENTION (A) Industrial Application Field This invention relates to a microcomputer that has two modes: an operation using an accumulator, a transfer mode and an operation using a memory, and a transfer mode. Microcomputers are classified into accumulator type, general-purpose register type, and memory type depending on the register configuration.The accumulator type has the advantage of a simple instruction format, and most 4- to 8-bit microcomputers belong to this type.General-purpose type The register method does not have an accumulator, but has general-purpose registers for arithmetic operations, transfers, and address calculations, and processes data using a two-address method. Because of its high degree of freedom, it is often used in 16-bit microcomputers. In addition, in the memory method, all registers are mapped on memory, and operations are performed between memories.Therefore, in order to take advantage of the advantages of each method described above, in recent years, an instruction set for the accumulator method and an instruction set for the memory method have been developed. Microphone viewers equipped with both of these functions are now available.
第3図を参照して従来のマイクロコンピュータを説明す
る。A conventional microcomputer will be explained with reference to FIG.
同図において、(11)は命令デコーダ、(12)はモ
ード切換フラグ、(13)はデータ切換回路、(14〉
はアキュムレータ、(15〉は算術論理演算ユニット(
以下、ALUと称する)、(16〉および(17〉はそ
れぞれ第1および第2のメモリ、(l8)は内部バスで
ある。In the figure, (11) is an instruction decoder, (12) is a mode switching flag, (13) is a data switching circuit, and (14) is a data switching circuit.
is an accumulator, (15〉 is an arithmetic logic unit (
(hereinafter referred to as ALU), (16> and (17>) are first and second memories, respectively, and (18) is an internal bus.
上記のように構成される従来のマイクロコンピュータで
メモリ間演算,転送(メモリモード)を行う場合には、
その演算,転送命令の実行に先立って、図示しない主記
憶回路に記述されたモードセット命令SF,が実行され
る。これにより、命令デコーダ(11)がメモリモード
フラグFMを出力し、モード切換フラグ〈12〉をセッ
トする.モード切換フラグ(12〉のセット出力はデー
タ切換回路(13〉のb接点とC接点を接続し、内部バ
ス(18)データ切換回路(13〉のb接点−C接点−
ALU(15)からなるパスを形成し、アキュムレータ
(14)を使用しない演算,転送を可能にする。When performing inter-memory calculations and transfers (memory mode) with a conventional microcomputer configured as described above,
Prior to execution of the calculation and transfer command, a mode set command SF written in a main memory circuit (not shown) is executed. As a result, the instruction decoder (11) outputs the memory mode flag FM and sets the mode switching flag <12>. The set output of the mode switching flag (12>) connects the B contact and C contact of the data switching circuit (13>), and connects the internal bus (18) to the data switching circuit (13>'s B contact - C contact -
A path consisting of the ALU (15) is formed to enable calculations and transfers without using the accumulator (14).
これに対して、アキュムレータを使用する演算,転送(
アキュムレータモード)を行う場合には、その演算,転
送命令の実行に先立って、図示しない主記憶回路に記述
されたモードリセット命令RFMが実行される。これに
より、命令デコーダ(11)がアキュムレータモードフ
ラグFAを出力し、モード切換フラグ(12〉をリセッ
トする。モード切換フラグ(12〉のリセット出力はデ
ータ切換回路(13)のa接点とC接点を接続し、内部
バス(18)一アキュムレータ(14)一データ切換回
路(13)のa接点〜C接点一ALU(15)のバスを
形成し、アキュムレータ(14)を使用する演算,転送
が行われる。In contrast, operations using accumulators, transfers (
When executing the accumulator mode), a mode reset instruction RFM written in a main memory circuit (not shown) is executed prior to execution of the calculation and transfer instructions. As a result, the instruction decoder (11) outputs the accumulator mode flag FA and resets the mode switching flag (12>).The reset output of the mode switching flag (12>) connects the a contact and the c contact of the data switching circuit (13). The internal bus (18), the accumulator (14), the A contact of the data switching circuit (13) to the C contact, and the ALU (15) are formed, and calculations and transfers using the accumulator (14) are performed. .
上記構成のマイクロコンピュータでは、スタート時を除
いてはアキュムレータモードにあるか、メモリモードに
あるかが確定しないため、ソフトウェア作成に際し細心
の注意が必要である。また、大規模のソフトウェアでは
ルーチン毎にモード切換フラグの初期設定が必要となる
等ソフトウェアの負担が大である欠点を有する。さらに
、ハードウェアの面からは、モードの変更のためのフラ
グリセット命令,フラグセット命令の2命令を要するた
め命令デコーダ(11)の構成が複雑となる欠点および
割込処理時にこのフラグを退避しなければならない欠点
を有する。In the microcomputer configured as described above, it is not determined whether the microcomputer is in accumulator mode or memory mode except at the time of start, so great care must be taken when creating software. In addition, large-scale software has the disadvantage that it imposes a large burden on the software, such as requiring initial setting of the mode switching flag for each routine. Furthermore, from a hardware perspective, the configuration of the instruction decoder (11) is complicated because it requires two instructions: a flag reset instruction and a flag set instruction to change the mode, and this flag must be saved during interrupt processing. It has its drawbacks.
{ハ}発明が解決しようとする課題
この発明は従来のマイクロコンピュータの上記した点に
鑑みなされたものであって、フラグリセット命令の実行
を要しないマイクロコンピュータを提供することを目的
とし、もって、ハードウェアが簡単な、ソフトウェアの
負担が軽いマイクロコンピュータを提供することにある
。{c} Problems to be Solved by the Invention The present invention has been made in view of the above-mentioned points of conventional microcomputers, and an object thereof is to provide a microcomputer that does not require execution of a flag reset instruction. The object of the present invention is to provide a microcomputer with simple hardware and light software load.
(二)課題を解決するための手段
上記問題点は、モード設定命令を解読する手段と、前記
手段の出力を次の命令サイクルの所定のタイミングまで
遅延する手段と、この遅延手段出力に基づいてALUの
アキュムレータ側入力端子にラムあるいはレジスタのデ
ータとアキュムレータのデータとを選択出力する手段と
を備えるマイクロコンピュータにより解決される。(2) Means for Solving the Problem The above problem is solved by the following: means for decoding the mode setting command; means for delaying the output of said means until a predetermined timing of the next command cycle; This problem can be solved by a microcomputer equipped with means for selectively outputting RAM or register data and accumulator data to the accumulator side input terminal of the ALU.
(ホ)作用
上記構成は、メモリモードがメモリモードの設定の次の
命令サイクルの終了と共に自動的に解除されることによ
りフラグリセット命令の実行を不要とするよう作用し、
もって、命令デコーダの構成を簡素化すると共にソフト
ウェアの負担を低減するよう作用する。(E) Effect The above configuration operates so that the memory mode is automatically canceled at the end of the instruction cycle following the setting of the memory mode, thereby eliminating the need to execute the flag reset instruction.
This simplifies the configuration of the instruction decoder and reduces the burden on software.
(へ〉実施例 第1図を参照して、この発明の一実施例を説明する。(to) Example An embodiment of the present invention will be described with reference to FIG.
同図において、符号(1){よ命令デコーダ、(2)は
RSフリッププロップあるいはDフリツプフロツプで構
成され、次の命令サイクルの間入力状態を保持する遅延
回路、(3)はワード単位のデータ切換回路、(4)は
アキュムレータ、(5〉はALU,(6)および(7)
は汎用レジスタあるいはラムに設定されるレジスタ、あ
るいはラム(以下の説明ではメモリに統一する)、(8
)は内部バスであって、データ切換回路(3)はその制
御信号がない状態では端子aと端子Cが閉じており、内
部バス(8)アキュムレータ(4)−A L U (5
)のバスが形成されることによりアキュムレータを使用
する演算動作(アキュムレータモード)が保証されてい
る。In the figure, (1) is an instruction decoder, (2) is a delay circuit composed of an RS flip-flop or a D flip-flop and holds the input state during the next instruction cycle, and (3) is a word-based data switch. circuit, (4) is an accumulator, (5> is an ALU, (6) and (7)
is a general-purpose register or a register set to RAM, or RAM (in the following explanation, it is unified to memory), (8
) is an internal bus, and in the data switching circuit (3), when there is no control signal, terminals a and C are closed, and the internal bus (8), accumulator (4) - ALU (5
) bus is formed, thereby guaranteeing an arithmetic operation using an accumulator (accumulator mode).
この実施例が実行可能な演算命令の一例は、(1)第1
才ペランド
←第1才ペランド+第2オペランド十CF(2〉第1才
ペランド
←第1オペランド+第2オペランド
(3)アキュムレータ
←アキュムレータ+第2オペランド
である。以下に、第2の演算動作を例に実施例の動作を
説明する。Examples of arithmetic instructions that can be executed by this embodiment are (1) first
Operand ← 1st operand + 2nd operand The operation of the embodiment will be explained as an example.
モード設定命令SFMが命令デコーダ(1)で解読され
ると、命令デコーダ(1)はメモリ間演算(メモリモー
ド)を指定するマイクロ命令F1を遅延回路(2)に出
力する。このマイクロ命令は同時に図示しない割込禁止
手段にも出力され、続く演算命令の実行の終了まで割込
が保留される。さらに、マイクロ命令FMは続く演算命
令の実行時に命令デコーダ(1)からアキュムレータ(
4)の図示しない入力ゲート制御のために出力される他
のマイクロ命令を第1才ペランドの入力ゲートの制御信
号に変更するためにも供されている。When the mode setting instruction SFM is decoded by the instruction decoder (1), the instruction decoder (1) outputs a microinstruction F1 specifying an inter-memory operation (memory mode) to the delay circuit (2). This microinstruction is simultaneously output to an interrupt inhibiting means (not shown), and the interrupt is suspended until the execution of the following arithmetic instruction is completed. Furthermore, the microinstruction FM is transferred from the instruction decoder (1) to the accumulator (
It is also provided for changing another microinstruction outputted for input gate control (not shown) in step 4) into a control signal for the input gate of the first input gate.
第2図タイミングチャートを参照してさらに詳細に説明
する。This will be explained in more detail with reference to the timing chart in FIG.
マイクロコンピュータは命令を主記憶回路からフェッチ
し、それを実行する命令サイクルを次々に繰り返す。現
実のマイクロコンビ二一タではフエツチサイクル、命令
実行サイクル共にさらに複雑なシーケンスから構成され
ているが、単純化すると、各サイクルはフエツチのため
の制御パルスφ,および実行のための制御パルスφ,の
2相パルスに基づいて2相動作すると説明できる。A microcomputer fetches instructions from its main memory circuit and executes them through a series of instruction cycles. In an actual microcombiner, both the fetch cycle and the instruction execution cycle are composed of more complex sequences, but to simplify it, each cycle consists of a control pulse φ for fetch and a control pulse φ for execution. , can be explained as two-phase operation based on two-phase pulses.
第2図(A)において、タイミングt,にてモード設定
命令S F Mが命令デコーダ(1)で解読されると、
タイミングt,にて命令デコーダ(1)がメモリモード
を指定するマイクロ命令FMを出力する。In FIG. 2(A), when the mode setting command S F M is decoded by the command decoder (1) at timing t,
At timing t, the instruction decoder (1) outputs a microinstruction FM specifying the memory mode.
このマイクロ命令FMをセット端子に入力し、前記命令
実行のための制御バルスφ,をリセット端子に入力する
RSフリップフロップはマイクロ命令FMの立ち下がり
でセットされ、制御パルスφ,の立ち上がりでリセット
されて次の命令サイクル、すなわち演算命令のフエツチ
・実行の期間ts,tmの期間のみハイレベルを出力す
る。このRSフリッププロップの出力により、データ切
換回路(3〉の接点が端子bと端子Cとを接続するよう
制御され、内部バス(8) − A L U (s>の
パスが形成される。The RS flip-flop, which inputs this microinstruction FM to the set terminal and inputs the control pulse φ, for executing the instruction to the reset terminal, is set at the falling edge of the microinstruction FM, and reset at the rising edge of the control pulse φ,. It outputs a high level only during the next instruction cycle, that is, during the fetch/execution periods ts and tm of the arithmetic instruction. By the output of this RS flip-flop, the contacts of the data switching circuit (3) are controlled to connect the terminals b and C, and a path of the internal bus (8) - ALU (s) is formed.
これにより、タイミングt,にて第1才ペランド,第2
オペランドで指定されるメモリ(6),メモリ(7〉の
データがシーケンシャルに、あるいは内部バス(8〉が
マルチバスであれば同時に加算モードにあるALU(5
)に入力される。このALU(5〉の加算結果は、タイ
ミングt,内のさらに細分化された後続するタイミング
にて第1オペランドで指定されるメモリ(6〉に出力さ
れる。As a result, at timing t, the first Pelland, the second
If the data in the memory (6) and memory (7) specified by the operand is sequential, or if the internal bus (8) is a multibus, the ALU (5) in addition mode is
) is entered. The addition result of this ALU (5>) is output to the memory (6>) designated by the first operand at a further subdivided subsequent timing within timing t.
タイミングts,tsで表されるさらに後続の命令サイ
クルにおいては、遅延回路(2〉の出力がローレベルと
なっているため、アキュムレータ(4)4−アキュムレ
ータ+第2オペランドなるアキュムレータを使用する演
算が実行される。In the subsequent instruction cycle represented by timings ts and ts, since the output of the delay circuit (2> is at a low level), the operation using the accumulator (4) 4 - accumulator + second operand is performed. executed.
?2図(B)は遅延回路(2)を構成するRSフリップ
プロップのリセット信号として分割された実行制御信号
φ11,φ.のうちφ■の立ち上がりを利用する実施例
のタイミングを説明している。同図において、タイミン
グt1にてモード設定命令SFMが命令デコーダ(1)
で解読されると、タイミングt■およびt。において命
令デコーダ1がメモリモードを指定するマイクロ命令F
Mを出力する。このマイクロ命令F1をセット端子に入
力し、前記命令実行のための制御バルスφ■をリセット
端子に入力するRSフリップフロップはマイクロ命令F
Mの立ち下がりでセットされ、制御パルスφ.の立ち上
がりでリセットされて次の命令サイクル、すなわち演算
命令のフェッチ・実行の期間jl+j41の期間のみハ
イレベルを出力する。このRSフリッププロップの出力
により、データ切換回路(3)の接点が端子bと端子C
とを接続するよう制御され、内部バス(8)− A L
U (5)のパスが形成される。? FIG. 2(B) shows divided execution control signals φ11, φ. The timing of an embodiment that utilizes the rising edge of φ■ is explained. In the figure, at timing t1, the mode setting command SFM is sent to the command decoder (1).
When decoded at timings t■ and t. The instruction decoder 1 specifies the memory mode in the microinstruction F
Output M. The RS flip-flop inputs this microinstruction F1 to the set terminal and inputs the control pulse φ■ for executing the instruction to the reset terminal.
M is set at the falling edge of control pulse φ. It is reset at the rising edge of , and outputs a high level only during the next instruction cycle, that is, the fetch/execution period jl+j41 of the arithmetic instruction. The output of this RS flip-flop causes the contacts of the data switching circuit (3) to switch between terminals B and C.
internal bus (8) - A L
A path of U (5) is formed.
これにより、タイミングt41にて第1才ペランド,第
2才ペランドで指定されるメモリ〈6),メモリ(7〉
のデータがシーケンシヶルに、あるいは内部バス(8〉
がマルチバスであれば同時に加算モードにあるALU(
5)に入力される.このALU(5)の加算結果は、タ
イミングt。にて第1才ペランドで指定されるメモリ(
6)に出力される.他のマイクロ命令を変形すれば、ア
キュムレータ←第1才ペランド+第2オペランドな・る
命令を実行するよう変更することも可能である.タイミ
ングji,taで表されるさらに後続の命令サイクルに
おいては、遅延回路(2)の出力がローレベルとなって
いるため、アキュムレータ4←アキュムレータ+第2才
ペランドなるアキュムレータを使用する演算が実行され
る。As a result, at timing t41, the memory (6) and memory (7) specified by the first and second peripheries are
data can be sent sequentially or via the internal bus (8)
If is a multibus, the ALU (
5) is input. The addition result of this ALU (5) is obtained at timing t. The memory specified by the first year old Peland (
6) is output. By modifying other microinstructions, it is also possible to execute an instruction such as accumulator ← 1st operand + 2nd operand. In the subsequent instruction cycle represented by timings ji and ta, since the output of the delay circuit (2) is at a low level, an operation using the accumulator 4←accumulator+2nd periphery is executed. Ru.
以上、遅延回路(2〉としてRSフリッププロップを使
用する例につき説明したが、同様にDフノップフロツプ
の使用が可能なことは当業者に明らかである.
(ト〉発明の効果
以上述べたようにこの発明によれば、モード設定命令を
フラグセット命令のみとすることができるため命令セッ
ト数が減少し、命令デコーダの構成がm素化されると共
にモード設定のためのプラグのリセットプログラムが不
要となるためソフトウエアの負担が軽く、さらに割込処
理時にフラグの退避が不要となる等の顕著な効果を奏す
るマイクロコンピュータを提供することができる。Although an example in which an RS flip-flop is used as the delay circuit (2) has been described above, it is clear to those skilled in the art that a D flip-flop can be used in the same way. According to the invention, since the mode setting command can be only a flag set command, the number of command sets is reduced, the configuration of the command decoder is simplified, and a plug reset program for mode setting is not required. Therefore, it is possible to provide a microcomputer that has a light burden on software and has remarkable effects such as no need to save flags during interrupt processing.
第1図はこの発明の一実施例の部分ブロック図、第2図
(A) , (B)はそれぞれ異なる実施例のタイミン
グチャート、第3図は従来例の部分ブロック図である。
(1) . (11)・・・命令デコーダ、 (2〉・
・・遅延回路、(3) , (13)・・・データ切換
回路、 (4) , (14)・・・アキュムレータ、
(5)(15)・・・ALU, (6),(7).
(16) , (17)・・・メモリ、 (8)(ta
)・・・内部バス、(12)・・・モード切換フラグ、
(九)・・・メモリモードフラグ、 (FA)・・・
アキュムレータモードフラグ。FIG. 1 is a partial block diagram of one embodiment of the present invention, FIGS. 2A and 2B are timing charts of different embodiments, and FIG. 3 is a partial block diagram of a conventional example. (1). (11)...Instruction decoder, (2>・
...Delay circuit, (3), (13)...Data switching circuit, (4), (14)...Accumulator,
(5) (15)...ALU, (6), (7).
(16), (17)...memory, (8)(ta
)...Internal bus, (12)...Mode switching flag,
(9)...Memory mode flag, (FA)...
Accumulator mode flag.
Claims (2)
力を次の命令サイクルの所定のタイミングまで遅延する
手段と、この遅延手段出力に基づいてALUのアキュム
レータ側入力端子にラムあるいはレジスタのデータとア
キュムレータのデータとを選択出力する手段とを備える
マイクロコンピュータ。(1) means for decoding a mode setting instruction; means for delaying the output of said means until a predetermined timing of the next instruction cycle; and based on the output of said delay means, data in the ram or register is sent to an input terminal on the accumulator side of the ALU. and means for selectively outputting the data of the accumulator.
出力の立ち下がりでセットされ、命令実行制御信号によ
りリセットされるRSフリップフロップで構成される請
求項1記載のマイクロコンピュータ。(2) The microcomputer according to claim 1, wherein the delay means is constituted by an RS flip-flop that is set at the falling edge of the output of the means for decoding the mode setting command and reset by the command execution control signal.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1186788A JPH0690733B2 (en) | 1989-07-19 | 1989-07-19 | Microcomputer |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1186788A JPH0690733B2 (en) | 1989-07-19 | 1989-07-19 | Microcomputer |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0351973A true JPH0351973A (en) | 1991-03-06 |
| JPH0690733B2 JPH0690733B2 (en) | 1994-11-14 |
Family
ID=16194602
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1186788A Expired - Fee Related JPH0690733B2 (en) | 1989-07-19 | 1989-07-19 | Microcomputer |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0690733B2 (en) |
-
1989
- 1989-07-19 JP JP1186788A patent/JPH0690733B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0690733B2 (en) | 1994-11-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH01297764A (en) | Processor | |
| JP2655615B2 (en) | Information processing device | |
| JP2993975B2 (en) | Central processing unit | |
| JP2752076B2 (en) | Programmable controller | |
| JPH0351973A (en) | Microcomputer | |
| JP2784001B2 (en) | Instruction processing circuit of programmable controller | |
| JPS60204029A (en) | Signal processing device | |
| JPH04230533A (en) | Interruption control circuit | |
| JPH04370832A (en) | Processor circuit | |
| JPS6128144A (en) | Trace operation execution device | |
| JP2604203B2 (en) | Debug device for one-chip digital signal processor | |
| JPS60178524A (en) | One-chip microcomputer | |
| JPS6375833A (en) | Information processor | |
| JPS62296236A (en) | microprocessor interrupt handler | |
| JPH02176832A (en) | Microcomputer | |
| JPH01137339A (en) | Microprocessor | |
| JPH01201730A (en) | Information processor | |
| JPH09101891A (en) | Information processor and exception processing sequencer | |
| JPS59168548A (en) | Program execution delaying device | |
| JPS62248043A (en) | Memory switching circuit for fetching microcomputer instruction | |
| JPS62224817A (en) | Data processor | |
| JPS6224325A (en) | arithmetic processing unit | |
| JPH01166222A (en) | Arithmetic circuit constitution for program controller | |
| JPH0358128A (en) | Information processor | |
| JPH03211628A (en) | Interrupt control method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |