JPH011032A - microcomputer circuit - Google Patents

microcomputer circuit

Info

Publication number
JPH011032A
JPH011032A JP62-155508A JP15550887A JPH011032A JP H011032 A JPH011032 A JP H011032A JP 15550887 A JP15550887 A JP 15550887A JP H011032 A JPH011032 A JP H011032A
Authority
JP
Japan
Prior art keywords
subroutine
rom
address
read
cpu
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
JP62-155508A
Other languages
Japanese (ja)
Other versions
JPS641032A (en
Inventor
高木 規之
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP15550887A priority Critical patent/JPS641032A/en
Priority claimed from JP15550887A external-priority patent/JPS641032A/en
Publication of JPH011032A publication Critical patent/JPH011032A/en
Publication of JPS641032A publication Critical patent/JPS641032A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 l産業上の利用分野] 本発明は、マイクロコンピュータ回路に関し、アキュー
ムレータの値等の条件に応じて読み出すサブルーチンを
変えるような場合、簡雫なプログラムで実現できるよう
にしたマイクロコンピュータの周辺回路に関する。
[Detailed Description of the Invention] Field of Industrial Application] The present invention relates to a microcomputer circuit, and is capable of realizing the change of a read subroutine depending on conditions such as the value of an accumulator with a simple program. Regarding peripheral circuits of microcomputers.

[従来の技術] 例えば、8ビツトマイクロコンピユータにおいては、ア
キュムレータ値の条件に応じて読み出すサブルーチンを
代えるような命令を持っていないため、例えば、第3図
に示すフt7−チャートを実現する場合、第4図又は第
5図に示す方法が採用されていた。
[Prior Art] For example, an 8-bit microcomputer does not have an instruction to change the subroutine to be read depending on the condition of the accumulator value. The method shown in FIG. 4 or 5 was adopted.

ここで、第4図の方式は、アキュムレータ値を比較命令
で調べ、条件と一致したとき、対応するサブルーチンを
読み出す方法である。
Here, the method shown in FIG. 4 is a method in which the accumulator value is checked using a comparison instruction, and when a condition is matched, the corresponding subroutine is read out.

一方、第5図の方式は、テーブルにジャンプ先アドレス
を書き込んでおき、アキュムレータ値に対応するジャン
プ先アドレスをプログラマブルカウンタにセットして分
岐し、処理終了後に予めメモリに退避しておいた戻り番
地に戻る方法である。
On the other hand, in the method shown in Figure 5, the jump destination address is written in the table, the jump destination address corresponding to the accumulator value is set in the programmable counter, the branch is made, and after the processing is completed, the return address is saved in memory in advance. This is the way to go back.

1、解決すべき問題点] 上述した従来の手法では、第4図に示す方法にあっては
読み出すサブルーチンの数が多くなると、サブルーチン
読み出しまでにかかる平均時間が増大するという問題が
あった。
1. Problems to be Solved] In the conventional method described above, the method shown in FIG. 4 has a problem in that as the number of subroutines to be read increases, the average time required to read the subroutines increases.

一方、第5図に示す方法にあっては、分岐数にかかわら
ず一定の時間で分岐できるが、ソフトウェアが複雑であ
り、多数のレジスタが必要になると共に、処理時間もか
かるという問題があった。
On the other hand, with the method shown in Figure 5, branches can be made in a fixed amount of time regardless of the number of branches, but the software is complex, requires a large number of registers, and takes processing time. .

そこで本発明の1′、1的とするところは、上述した従
来の問題点を解決し、例えばアキュムレータの値に応じ
て読み出すサブルーチンを変えたい場合等であっても、
簡?)1−なプログラムで迅速に処理することができる
マイクロコンピュータ回路を提供することにある。
Therefore, the first object of the present invention is to solve the above-mentioned conventional problems, and even when it is desired to change the reading subroutine depending on the value of the accumulator, for example,
Easy? ) An object of the present invention is to provide a microcomputer circuit that can quickly process a program.

1問題手点の解決手段] 本発明は、読み出したいサブルーチンのアドレスを上位
アドレス、下位アドレスに別けて配列したサブルーチン
上位アドレスROM、サブルーチン下位アドレスROM
と、この配列されたサブルーチンアドレスの何番目を呼
び出すかをCI) Uからのアキュムレータ値を書き込
むことによって指定するレジスタ回路と、CP UがC
all命令の命令コードを読み込んだことを検出し、こ
れに続く2つのメモリリードサイクルのうち、初めのサ
イクルでサブルーチン下位アドレスROMを、次のサイ
クルでサブルーチン上位アドレスROMを選択する信号
を出力し、この間プログラム用ROMを非アクティブと
するCall命令コントロール回路とを設けてマイクロ
コンピュータ回路を構成している。
Solution to Problem 1] The present invention provides a subroutine upper address ROM and a subroutine lower address ROM in which addresses of subroutines to be read are arranged separately into upper addresses and lower addresses.
and the register circuit that specifies by writing the accumulator value from CI) the number of this arranged subroutine address to call, and the CPU
Detects that the instruction code of the all instruction has been read, and outputs a signal to select the subroutine lower address ROM in the first cycle of the following two memory read cycles, and the subroutine upper address ROM in the next cycle, A microcomputer circuit is constructed by providing a call command control circuit that deactivates the program ROM during this time.

[実施例] 次に、本発明の一実施例を図面を参照して説明する。[Example] Next, one embodiment of the present invention will be described with reference to the drawings.

第1図は、本発明の一実施例であるマイクロコンピュー
タ回路のブロック回路図である。
FIG. 1 is a block circuit diagram of a microcomputer circuit that is an embodiment of the present invention.

同図において、1はCP LJ、2はシステムクロック
を発振するり■コック回路、3はCall命令コントロ
ール回路、4はアドレスデコーダ、5はレジスタ回路、
6はサブルーチン下位アドレスROM、7はサブルーチ
ン上位アドレスROM、8はプログラム蓄積用ROM、
9はパスバッファ、10はRA Mである。
In the figure, 1 is a CP LJ, 2 is a cock circuit that oscillates the system clock, 3 is a call instruction control circuit, 4 is an address decoder, 5 is a register circuit,
6 is a subroutine lower address ROM, 7 is a subroutine upper address ROM, 8 is a program storage ROM,
9 is a path buffer, and 10 is a RAM.

本実施例装置において、第3図のようなアキュムレータ
値に応じてサブルーチンを読み出す場合について説明す
ると、第2図(A)、(B)に示すように、前記サブル
ーチン下位、上位アドレスROM6.7には、サブルー
チンの下位、上位アドレスが配列されている。
In this embodiment, when a subroutine is read out according to the accumulator value as shown in FIG. 3, as shown in FIGS. The lower and upper addresses of subroutines are arranged.

まず、CPUIはOUT命令等でレジスタ回路5にアキ
ュムレータ値を書き込む。このとき、アキュムレータ値
がnであったとすると、レジスタ回路5の出力値はnと
なり、サブルーチン下位。
First, the CPU writes an accumulator value into the register circuit 5 using an OUT command or the like. At this time, if the accumulator value is n, the output value of the register circuit 5 is n, which is the lower part of the subroutine.

上位アドレスROM6.7は、n番地が指定される。ま
た、このときCall命令コントロール回路3が起動さ
れ、CPUIが実行する命令コードの監視を開始し、一
方、CPU1はプログラム蓄積用ROM8にかかれてい
るプログラムを実行してゆく。
For the upper address ROM 6.7, address n is designated. At this time, the call instruction control circuit 3 is activated and starts monitoring the instruction code executed by the CPU, while the CPU 1 executes the program stored in the program storage ROM 8.

ここで、CallX、 Yというサブルーチンを呼ぶ3
バイト命令がプログラム蓄積用ROM8にかかれている
場合を説明する。
Here, call the subroutines CallX and Y3.
A case where a byte instruction is stored in the program storage ROM 8 will be explained.

従来技術では、CP U 1は、 ■Call命令の命令コード、 ■サブルーチンの下位アドレス(ここではYアドレス) ■サブルーチンの上位アドレス(ここではXアドレス) の順にプログラム蓄積用ROM 8を読み、CallX
In the conventional technology, the CPU 1 reads the program storage ROM 8 in the following order: 1) the instruction code of the Call instruction, 2) the lower address of the subroutine (here, the Y address), and 2) the higher address of the subroutine (here, the X address), and
.

Yを実行していた。I was doing Y.

本実施例装置では、Call命令コントロール回路3が
■のサイクルでCP U 1がCall命令の命令コー
ドを読み込んだことを検出し、■のサイクルでYO出力
をアクティブとする。これにより、サブルーチン下位ア
ドレスROM6及びパスバッファ9がアクデイプとなり
、プログラム蓄積用ROM8が非アクティブとなる。
In the device of this embodiment, the Call instruction control circuit 3 detects that the CPU 1 has read the instruction code of the Call instruction in the cycle (2), and makes the YO output active in the cycle (2). As a result, the subroutine lower address ROM 6 and the pass buffer 9 become active, and the program storage ROM 8 becomes inactive.

サブルーチン下位アドレスROM 6からは、レジスタ
回路5によって指定されたn番地の値N2がパスバッフ
ァ9を介してデータバス上に出力され、これをC))U
lが読み込むことになる。
From the subroutine lower address ROM 6, the value N2 at address n specified by the register circuit 5 is output onto the data bus via the path buffer 9, and is sent to C))U.
l will be read.

次の■のサイクルでは、Call命令コントロール回路
3はY1出力をアクティブすることになる。
In the next cycle (2), the Call instruction control circuit 3 activates the Y1 output.

これにより、サブルーチン上位アドレスROM7及びパ
スバッファ9がアクティブ、ブt7グラム蓄積用flO
M8が非アクティブとなり、■の場合と同様に、サブル
ーチン上位アドレスROM7のn番地の値N1をC))
 U 1が読み込むことになる。
As a result, the subroutine upper address ROM 7 and the pass buffer 9 become active, and the t7gram storage flO
M8 becomes inactive, and as in the case of ■, the value N1 at address n of the subroutine upper address ROM7 is changed to C)).
U1 will read it.

上記の通り、■、■のサイクルではプログラム蓄積用I
t OM 8は禁止されており、X、Yは実際にはデー
タバス上に出力されることはないなめ、データの折欠は
起こらない。これにより、CI) Ulはアキュムレー
タの値nに対応したサブルーチンNl 、N2を実行す
ることになる。
As mentioned above, in the cycles ■ and ■, the program storage I
Since t OM 8 is prohibited and X and Y are not actually output onto the data bus, no data breaks occur. As a result, CI) Ul executes subroutines Nl and N2 corresponding to the value n of the accumulator.

ここで、本実施例と従来技術とを比較すると、本実施例
装置では、OU ’r’命令、Call命令の2つの命
令だけ第3図のフローチャートを実現でき、CI) U
サイクルで27ステート(OUT・・・10ステート、
Call・・・17ステート)で済む。
Here, when comparing this embodiment with the conventional technology, the device of this embodiment can realize the flowchart shown in FIG. 3 with only two instructions, the OU 'r' instruction and the Call instruction.
27 states in a cycle (OUT...10 states,
Call...17 states).

これに対し、第4図の場合には、比軸命令、 Ca11
命令を繰り返すなめ、n回の比較をしたと仮定すると、
7・n−1−10(n−1) −1−27スデート必要
であり(比較・・・7スデート、一致しないとき次の比
較へ進む・・・10ステート、一致したときジャンプ7
ICall・・・27ステート)、nが増せばステート
数も大幅に増大してしまう。一方、第5図の場合は81
ステート必要である。
On the other hand, in the case of Fig. 4, the ratio axis command, Ca11
Assuming that you repeat the command and compare n times,
7・n-1-10(n-1) -1-27 sdate is necessary (comparison... 7 sdate, if not match proceed to next comparison...10 states, if match jump 7
ICall...27 states), as n increases, the number of states also increases significantly. On the other hand, in the case of Figure 5, 81
State is required.

このように、本実施例によれば、処理の実行が簡易であ
ると共に、処理時間も大幅に雉縮することができる。
As described above, according to this embodiment, the processing can be easily executed and the processing time can be significantly reduced.

尚、本発明は上記実施例に限定されれるものではなく、
本発明の要旨の範囲内で種々の変形実施が可能である。
Note that the present invention is not limited to the above embodiments,
Various modifications are possible within the scope of the invention.

[発明の効果] 以上説明したように、本発明によればCal+命令の前
にレジスタ回路に読み出したいサブルーチンに対応した
値を書き込むだけで、それに応じたサブルーチンを読み
出すことができる。
[Effects of the Invention] As described above, according to the present invention, a subroutine corresponding to the subroutine to be read can be read by simply writing a value corresponding to the subroutine to be read into the register circuit before the Cal+ instruction.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例装置のブロック回路図、第2
図(A>、(B)はそれぞれサブルーチン上位アドレス
ROM、サブルーチン下位アドレスROMの内容の一例
を示す概略説明図、第3図はアキュムレータ値に対応し
たサブルーチンを読み出す場合のフローチャート、第4
図、第5図は第3図のフローチャーを実現するための従
来の詳細な手順を示すフローチャートである。 1;CPU、 3;Call命令コントロール回路、 5;レジスタ回路、 6;サブルーチン下位アドレスROM、7;サブルーチ
ン上位アドレスROM、8;プログラム用ROM。 代理人 弁理士 渡 辺 喜 平 第1図 第2図 (Al                (81第3図
FIG. 1 is a block circuit diagram of a device according to an embodiment of the present invention, and FIG.
Figures (A> and (B) are schematic explanatory diagrams showing examples of the contents of the subroutine upper address ROM and the subroutine lower address ROM, respectively. Figure 3 is a flowchart when reading the subroutine corresponding to the accumulator value.
5 are flowcharts showing detailed conventional procedures for realizing the flowchart of FIG. 3. 1: CPU, 3: Call instruction control circuit, 5: Register circuit, 6: Subroutine lower address ROM, 7: Subroutine upper address ROM, 8: Program ROM. Agent Patent Attorney Kihei Watanabe Figure 1 Figure 2 (Al (81 Figure 3)

Claims (1)

【特許請求の範囲】[Claims] CPUと、このCPUが実行するプログラムを蓄積した
プログラム用ROMと、前記CPUからのサブルーチン
アドレスがサブルーチンアドレスROMの何番目にある
かが書き込まれるレジスタ回路と、このレジスタ回路に
接続され、上位アドレスが配列されているサブルーチン
上位アドレスROMと、前記レジスタ回路に接続され、
サブルーチンの下位アドレスが配列されている下位アド
レスROMと、CPUがCall命令の命令コードを読
み込んだことを検出し、これに続く2つのメモリリード
サイクルのうち、初めのサイクルでサブルーチン下位ア
ドレスROMを、次のサイクルでサブルーチン上位アド
レスROMを選択する信号を出力し、この問プログラム
用ROMを非アクティブとするCall命令コントロー
ル回路とを設けたことを特徴とするマイクロコンピュー
タ回路。
A CPU, a program ROM that stores programs to be executed by the CPU, a register circuit in which the location of the subroutine address from the CPU in the subroutine address ROM is written; connected to the arranged subroutine upper address ROM and the register circuit,
The CPU detects that the lower address ROM in which the lower addresses of the subroutine are arranged and the instruction code of the Call instruction is read, and the subroutine lower address ROM is read in the first cycle of the following two memory read cycles. A microcomputer circuit comprising: a call instruction control circuit which outputs a signal for selecting a subroutine upper address ROM in the next cycle and makes the program ROM inactive.
JP15550887A 1987-06-24 1987-06-24 Microcomputer circuit Pending JPS641032A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15550887A JPS641032A (en) 1987-06-24 1987-06-24 Microcomputer circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15550887A JPS641032A (en) 1987-06-24 1987-06-24 Microcomputer circuit

Publications (2)

Publication Number Publication Date
JPH011032A true JPH011032A (en) 1989-01-05
JPS641032A JPS641032A (en) 1989-01-05

Family

ID=15607581

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15550887A Pending JPS641032A (en) 1987-06-24 1987-06-24 Microcomputer circuit

Country Status (1)

Country Link
JP (1) JPS641032A (en)

Similar Documents

Publication Publication Date Title
US4672534A (en) Integrated circuit device incorporating a data processing unit and a ROM storing applications program therein
EP0569969A1 (en) Microcomputer having instruction memory storing instructions for reading out internal conditions
EP0313097B1 (en) Microcomputer system including master processor and slave processor
JPH05108548A (en) Dma controller
JPH011032A (en) microcomputer circuit
JPS60189047A (en) data processing equipment
JPH04280334A (en) One chip microcomputer
JPS603049A (en) Bus interface apparatus
JPS63280333A (en) microprogram controller
JPH0481939A (en) Control system for microcomputer
JPH0333934A (en) Register saving/recovering system
JPH1083384A (en) Microcomputer
JPS62269237A (en) Data processor
JPS636637A (en) Memory switching device
JPS5914061A (en) Switching circuit of memory bank
JPS60193046A (en) Instruction exception detection method
JPS62243038A (en) Evaluating device for program
JPS63257044A (en) Programmable memory mapping system
JPS63265332A (en) Program jump method
JPH06242964A (en) Interruption processing system and microcomputer
JPS61272856A (en) Processor control system
JPS619733A (en) Test device
JPH03257572A (en) Multiprocessor system
JPH0635750A (en) Semiconductor integrated circuit device
JPS63241636A (en) Data processor