JPH02110739A - Central processing unit for multi-task - Google Patents

Central processing unit for multi-task

Info

Publication number
JPH02110739A
JPH02110739A JP26447688A JP26447688A JPH02110739A JP H02110739 A JPH02110739 A JP H02110739A JP 26447688 A JP26447688 A JP 26447688A JP 26447688 A JP26447688 A JP 26447688A JP H02110739 A JPH02110739 A JP H02110739A
Authority
JP
Japan
Prior art keywords
task
program
time
register
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
JP26447688A
Other languages
Japanese (ja)
Inventor
Morihito Morishima
守人 森島
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.)
Yamaha Corp
Original Assignee
Yamaha 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 Yamaha Corp filed Critical Yamaha Corp
Priority to JP26447688A priority Critical patent/JPH02110739A/en
Publication of JPH02110739A publication Critical patent/JPH02110739A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To decrease the loss of a time due to an interrupting processing when the multi-task processing is carried out by switching so that a task set corresponding to the task in which a CPU is presently executed can be selected by a task register and can be operated based on an arithmetic unit. CONSTITUTION:A task set 7a is composed of a program counter 1a, an accumulator 2a, a register 3a and a flag register 4a, the same number of the task sets 7a as the program is prepared and at the time of executing one program, one set is used. Each time three programs A to C are switched for a certain constant time and for a T time, task sets 7a to 7c corresponding to respective programs A to C are selected by a task register 5, switching is executed so as to operate based on the arithmetic unit and the action is repeated until respective programs are completed. Thus, at the time of being the multi-task processing, the time loss at the time of changing the program can be decreased.

Description

【発明の詳細な説明】 「産業上の利用分野」 この発明は、複数のプログラムを1つの演算装置により
、見掛は上回時に実行するマルチタスク用中央処理装置
に関する。
DETAILED DESCRIPTION OF THE INVENTION "Field of Industrial Application" The present invention relates to a multitasking central processing unit that executes a plurality of programs by one arithmetic unit at apparently higher speeds.

「従来の技術」 従来、マルチタスク処理の一方法として時間分割方式(
タイム・シェアリング・システム)がある。これは中央
処理装置(CP U)の実行時間を細かく分割して、複
数のプログラムを順番に少しずつ行うことで、見掛は上
回時に実行する方法である。
"Conventional technology" Conventionally, a time division method (
time sharing system). This is a method in which the execution time of the central processing unit (CPU) is divided into small parts, and multiple programs are executed in sequence little by little, so that the execution time is apparently exceeded.

第3図(イ)、(ロ)は各々、従来の主記憶装置内のプ
ログラム構成概念図およびプログラム実行の概念図であ
る。
FIGS. 3(a) and 3(b) are a conceptual diagram of a program structure in a conventional main storage device and a conceptual diagram of program execution, respectively.

まず、プログラムの実行にあたり、CPU内のプロゲラ
l−カウンタ、アキュムレータ、レジスタおよびフラグ
レジスタで構成されるタスクセットが初期化される。こ
の初期化によりプログラムカウンタはn。となり、CP
UによりプログラムAがn。番地から実行される(第3
図(ロ)参照)。
First, upon execution of the program, a task set consisting of a progera l-counter, an accumulator, a register, and a flag register in the CPU is initialized. This initialization sets the program counter to n. Then, CP
Program A is n by U. Executed from address (3rd
(See figure (b)).

そして、1時間後、時刻P1にて自動的にcPUに割り
込みか掛かる。この場合、CPUは割す込みが掛かった
時点で実行途中にあった命令を最後まで実行する。次に
、CPUはマルチタスクに必要な処理を行う。すなわち
、まずタスクセットの内容を主記憶装置内の所定のエリ
アに退避する。
Then, one hour later, an interrupt is automatically applied to the cPU at time P1. In this case, the CPU executes to the end the instruction that was in the middle of execution when the interrupt occurred. Next, the CPU performs processing necessary for multitasking. That is, first, the contents of the task set are saved to a predetermined area within the main memory.

そして、次にプログラムBか以前に実行されてぃれば、
主記憶装置内の所定のエリアからプログラムBの実行に
必要なタスクセットの内容を読出す。
Then, if program B was previously executed,
The contents of the task set necessary for executing program B are read from a predetermined area in the main memory.

ここでは、プログラムBはまだ一度も実行されていない
ため、プログラムカウンタはプログラムI3の開始番地
を示めしており、プログラムBはn3番地から実行され
る。そして、次の1時間後、時刻P2にて再びCPUに
割り込みが掛かり、前回の割り込みの場合同様、プログ
ラムカウンタなとの内容が主記憶装置内の所定のエリア
へ退避される。
Here, since program B has never been executed, the program counter indicates the start address of program I3, and program B is executed from address n3. Then, one hour later, the CPU is again interrupted at time P2, and the contents of the program counter are saved to a predetermined area in the main storage device, as in the case of the previous interruption.

また、プログラムCに対するタスクセットの各内容がC
PUの所定のエリアへ復帰させられる(第3図(ロ)参
照)。
Also, each content of the task set for program C is
It is returned to the predetermined area of the PU (see FIG. 3 (b)).

上記割り込み処理を終えたCPUは、プログラムB同様
にプログラムCをn8番地から実行する。
After completing the above interrupt processing, the CPU executes program C from address n8 in the same way as program B.

そして、再び時刻P3にて割り込みが掛かると、CPU
により割り込み処理か実行される。この場合には、既に
プログラムΔは一度実行されているので、プログラムA
に対する前回の割り込み処理で退避したタスクセットの
内容が読み込まれ、CPU内の所定のエリアに復帰させ
られる。この時、プログラムカウンタは前回終了したア
ドレスの次のアドレス、例えば01番地を示しているの
で、プログラムAは前回に引き続きn1番地から実行さ
れる。そして、次の1時間後、時刻P4て再びCPUに
割り込みか掛かり、CPUは割り込み処理を行う。 こ
の処理により」二記同様、プログラムBに対応する前回
退避したタスクセットの内容か復帰され、CPUにより
プログラムBの04番地から実行される(第3図(イ)
参照)。
Then, when an interrupt occurs again at time P3, the CPU
interrupt processing is executed. In this case, since program Δ has already been executed once, program A
The contents of the task set saved in the previous interrupt processing are read and returned to a predetermined area within the CPU. At this time, since the program counter indicates the address next to the address that ended last time, for example, address 01, program A is executed from address n1 following the last time. Then, one hour later, at time P4, the CPU is again interrupted, and the CPU performs the interrupt processing. Through this process, as in Section 2, the contents of the previously saved task set corresponding to program B are restored, and program B is executed by the CPU from address 04 (Figure 3 (a)).
reference).

以上のようにCPUによるプログラムの実行、1時間毎
の割り込みおよび割り込み処理へ−〜C−か各プログラ
ムA−Cか終了するまで繰り返し行われる。
As described above, execution of programs by the CPU, hourly interrupts, and interrupt processing are repeated until each program A to C is completed.

「発明か解決しようとする課題」 ところで、上述した従来のマルチタスク処理の方法では
、CPUにより実行されるフログラムが変更されるたび
に割り込み処理か行われるためタイムロスを生し、見掛
は上CPUの実行速度が遅(なるという問題か生じた。
``Problem to be solved by the invention'' By the way, in the conventional multitasking method described above, interrupt processing is performed every time the program executed by the CPU is changed, resulting in time loss, and the apparent problem is that the upper CPU There was a problem that the execution speed was slow.

この発明は、」−述の問題に鑑みてなされたちので、マ
ルチタスク処理に際し、割り込み処理によるタイムロス
を軽減し、CPUの実行速度を落とすことのないマルチ
タスク用中央処理装置を提供することを目的としている
The present invention was made in view of the problems mentioned above, and an object of the present invention is to provide a central processing unit for multitasking that reduces time loss due to interrupt processing during multitasking and does not reduce the execution speed of the CPU. It is said that

「課題を解決するための手段」 このような問題点を解決するために、この発明ではプロ
グラムカウンタと、アキュムレータと、演算結果の状態
を表すフラグレジスタと、演算に必要なデータの一時記
憶をするレジスタとを有するタスクセットを複数設け、
現在実行しているタスクを示し当該タスクに対応する前
記タスクセットを選択するタスクレジスタとを具備する
ことを特徴とする。
"Means for Solving the Problem" In order to solve these problems, the present invention provides a program counter, an accumulator, a flag register representing the state of the operation result, and temporary storage of data necessary for the operation. Provide multiple task sets with registers,
The present invention is characterized by comprising a task register that indicates a currently executing task and selects the task set corresponding to the task.

「作用」 タスクレジスタにより、現在CPUが実行しているタス
クか示され、このタスクに対応したプログラムカウンタ
、アキュムレータ、レジスタおよびフラグレジスタで構
成されるタスクセットが当該タスクレジスタにより選択
され、演算装置のもとて動作すべく切換えが行なわれる
"Operation" The task register indicates which task is currently being executed by the CPU, and the task set consisting of the program counter, accumulator, register, and flag register corresponding to this task is selected by the task register, and the task register is used to control the processing unit. A switch is made to operate as usual.

「実施例」 次の図面を参照してこの発明の実施例について説明する
"Embodiments" Examples of the present invention will be described with reference to the following drawings.

第1図は、この発明の一実施例の構成を示すブロック図
である。この図において、1aはプログラムカウンタ、
2aはアキュムレータ、3aはアキュムレータ2aを補
助するためのレジスタであり、演算に用いられるデータ
、主記憶装置のアドレスを示すデータおよび演算結果な
との一時記憶をする。4aはアキュムレータ2aの演算
結果の状態を表すフラグレジスタである。これらのプロ
グラムカウンタla、アキュムレータ2 a % レジ
スタ3aおよびフラグレジスタ4aによりタスクセット
7aが構成されている。このタスクセット7aがプログ
ラムと同数個用意され、1つのプログラムの実行に際し
1つの組が用いられるようになっている。この実施例で
は3つのプログラムA、BおよびCか実行されるように
なっており(第2図(イ)参照)、各々プログラムに対
しタスクセット7a、7bおよび7cか用意されている
。5は現在CPUに実行されるタスクを示し、そのタス
クのプログラムに対応したタスクセットを選択するタス
クレジスタである。このタスクレジスタ5からは、1つ
のタスクセットを選択するために各組のプログラムカウ
ンタ、アキュムレータ、レジスタおよびフラグレジスタ
へ選択信号SELが供給されるようになっている。また
、6は各々のタスクセット7a、7bおよび7cと演算
装置との間でデータを送受するためのCPU内の内部デ
ータバスである。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention. In this figure, 1a is a program counter,
2a is an accumulator, and 3a is a register for assisting the accumulator 2a, which temporarily stores data used in calculations, data indicating addresses of the main storage device, and calculation results. 4a is a flag register representing the state of the operation result of the accumulator 2a. These program counter la, accumulator 2 a % register 3 a, and flag register 4 a constitute a task set 7 a. The same number of task sets 7a as programs are prepared, and one set is used when one program is executed. In this embodiment, three programs A, B, and C are to be executed (see FIG. 2(a)), and task sets 7a, 7b, and 7c are prepared for each program. Reference numeral 5 denotes a task register that indicates a task currently being executed by the CPU and selects a task set corresponding to the program of that task. A selection signal SEL is supplied from the task register 5 to each set of program counter, accumulator, register, and flag register in order to select one task set. Further, 6 is an internal data bus within the CPU for transmitting and receiving data between each of the task sets 7a, 7b, and 7c and the arithmetic unit.

次に、上記構成によるこの実施例の動作について説明す
る。
Next, the operation of this embodiment with the above configuration will be explained.

まず、プログラムの実行にあたりCPU内のタスクセッ
ト7a、7b、7cおよびタスクレジスタ5か初期化さ
れる。この初期化でタスクレジスタ5によりタスクセッ
ト7aが選択され、このタスクセット7aの内容にもと
ずき、CPUが動作する。すなわち、プログラムカウン
タ1aが初期化によりn。から順次命令の記憶されてい
るアドレスを指示していくので、プログラムAはn。番
地から実行される。この実行中のデータおよび演算結果
の一時記憶、フラグの表示などには、アキュムレータ2
a、レジスタ3aおよびフラグレジスタ4aが用いられ
る。そして、1時間後、時刻P5にてCPUに割り込み
が掛かり、タスクレジスタ5によりタスクセット7bが
選択される。また、いままで選択されていたタスクセフ
1−7aの各々の内容は、つきに選択されるまで割り込
みの掛かった時点での内容、例えばプログラムカウンタ
1aにAdr、n、か保持される。
First, upon execution of the program, task sets 7a, 7b, 7c and task register 5 in the CPU are initialized. In this initialization, the task set 7a is selected by the task register 5, and the CPU operates based on the contents of this task set 7a. That is, the program counter 1a is initialized to n. Since the addresses where the instructions are stored are sequentially specified from the beginning, program A is n. Executed from address. Accumulator 2 is used for temporary storage of data and calculation results during execution, display of flags, etc.
a, register 3a and flag register 4a are used. One hour later, the CPU is interrupted at time P5, and the task register 5 selects task set 7b. Further, the contents of each of the tasks 1-7a that have been selected so far are held at the time of the interrupt, for example, Adr, n, in the program counter 1a until they are selected again.

次に、新たに選択されたb組は、a組同様、プログラム
カウンタ1bがプログデムBの開始番地から順次命令の
記憶されているアドレスを指示していくので、プログラ
ムBは03番地から実行される。また、実行中のデータ
および演算結果などの一時記憶には、アキュムレータ2
b、レジスタ3bおよびフラグレジスタ4bが用いられ
る。そして、次の1時間後、再び時刻P6にてCPUに
割り込みが掛かり、タスクレジスタ5によりタスクセフ
l−7cが選択される。また、いままで演算装置のもと
で動作していたタスクセット7bの各々の内容は、タス
クセフh 7 a同様、つぎに選択されるまで割り込み
の掛かった時点での内容、例えばプログラムカウンタ1
bにAd r、ntが保持される。
Next, in the newly selected group B, like the group A, the program counter 1b sequentially indicates the addresses where instructions are stored starting from the start address of program B, so program B is executed from address 03. . In addition, an accumulator 2 is used for temporary storage of data being executed and calculation results.
b, register 3b and flag register 4b are used. Then, one hour later, the CPU is again interrupted at time P6, and the task register 5 selects task SEF l-7c. In addition, the contents of each task set 7b that has been operating under the arithmetic unit until now are the same as the task set h7a until the next selection, for example, the contents of the program counter 1.
Ad r, nt is held in b.

そして、プログラムA、B同様にCPUによりフログラ
ムCが08番地から実行され、実行中のデータおよび演
算結果なとの一時記憶には、アキュムレータ2C,レジ
スタ3cおよびフラグレジスタ4cが用いられる。そし
て、再度CPUに時刻P7にて割り込みが掛かり、プロ
グラムCの実行が中断され、タスクレジスタ5によりタ
スクセット7aが選択される。また、タスクセット7c
の内容はつぎのタスクレジスタ5の選択まで保持される
Then, like programs A and B, program C is executed by the CPU from address 08, and an accumulator 2C, a register 3c, and a flag register 4c are used to temporarily store the data being executed and the results of calculations. Then, the CPU is again interrupted at time P7, execution of program C is interrupted, and task set 7a is selected by task register 5. Also, task set 7c
The contents of are held until the next task register 5 is selected.

再度タスクレジスタ5によって選択されたタスクセット
7aのプログラムカウンタ1aには、次に実行すべきプ
ログラムAの開始アドレスAd r。
The program counter 1a of the task set 7a selected by the task register 5 again contains the start address Adr of the program A to be executed next.

n、が保持されている。また、アキュムレータ2aルジ
スタ3aおよびフラグレジスタ4aには、プログラムノ
yウンタ1a同様、実行を中断した時点での各々の内容
が記憶されている。従って、プログラムAは前回に継続
してn5番地から実行される。以下同様に割り込みが掛
かるとタスクレジスタ5によりタスクセット7bが選択
され、プログラムカウンタ2bに保持されたアドレスに
従い、プログラムBが04番地から実行される。
n, is retained. Further, the contents of the accumulator 2a, the register 3a, and the flag register 4a at the time when the execution is interrupted are stored, similarly to the program counter 1a. Therefore, program A is executed from address n5, continuing from the previous program. Similarly, when an interrupt occurs, task set 7b is selected by task register 5, and program B is executed from address 04 according to the address held in program counter 2b.

以」二のように、3つのプログラムΔ、BおよびCかあ
る一定の時間、1時間毎に切り換わるたびに、各プログ
ラムA−Cに対応したタスクセット7a、7bおよび7
cかタスクレジスタ5により選択され、演算装置のもと
で動作すべく切り換えが行なわれる。この動作か各プロ
グラムか終了するまで繰り返し行われる。
As shown in ``2'' below, each time the three programs Δ, B and C are switched every hour for a certain period of time, the task sets 7a, 7b and 7 corresponding to each program A to C are changed.
c is selected by the task register 5, and switching is performed to operate under the arithmetic unit. This operation is repeated until each program is finished.

「発明の効果」 以上説明したように、この発明によればマルチタスク処
理に際し、プログラム変更時のタイムロスを軽減し、C
PUの実行速度を落とさず、効率よくプログラムを実行
できる利点か得られる。
"Effects of the Invention" As explained above, according to the present invention, when performing multi-task processing, it is possible to reduce time loss when changing programs, and to
This provides the advantage of being able to efficiently execute programs without reducing the execution speed of the PU.

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

第1図はこの発明の一実施例の構成を示すブロック図、
第2図(イ)、(ロ)は各々、主記憶装置内のプログラ
ム構成概念図およびプログラム実行の概念図、第3図(
イ)、(ロ)は各々、従来の主記憶装置内のプログラム
構成概念図およびプログラム実行の概念図である。 1a〜IC・・・・・・プログラムカウンタ、2a〜2
C・・・・・・アキユムレータ、3a〜3c・・・・・
・レジスタ、4a〜4C・・・・・フラグレジスタ、5
・・・タスクレジスタ、6・・・・CPU内部データバ
ス、7a〜7C・・・・・・タスクセット、SEL・・
・・・・選択信号。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention.
Figures 2 (a) and (b) are a conceptual diagram of the program structure in the main memory and a conceptual diagram of program execution, and Figure 3 (
(a) and (b) are a conceptual diagram of a program configuration in a conventional main storage device and a conceptual diagram of program execution, respectively. 1a~IC...Program counter, 2a~2
C...Accumulator, 3a-3c...
・Registers, 4a to 4C...Flag register, 5
...Task register, 6...CPU internal data bus, 7a to 7C...Task set, SEL...
...Selection signal.

Claims (1)

【特許請求の範囲】[Claims] プログラムカウンタと、アキュムレータと、演算結果の
状態を表すフラグレジスタと、演算に必要なデータの一
時記憶をするレジスタとを有するタスクセットを複数設
け、現在実行しているタスクを示し当該タスクに対応す
る前記タスクセットを選択するタスクレジスタとを具備
することを特徴とするマルチタスク用中央処理装置。
A plurality of task sets each having a program counter, an accumulator, a flag register representing the state of the operation result, and a register for temporarily storing data necessary for the operation are provided to indicate the currently executing task and correspond to the task. A multitasking central processing unit comprising: a task register for selecting the task set.
JP26447688A 1988-10-20 1988-10-20 Central processing unit for multi-task Pending JPH02110739A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP26447688A JPH02110739A (en) 1988-10-20 1988-10-20 Central processing unit for multi-task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP26447688A JPH02110739A (en) 1988-10-20 1988-10-20 Central processing unit for multi-task

Publications (1)

Publication Number Publication Date
JPH02110739A true JPH02110739A (en) 1990-04-23

Family

ID=17403757

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26447688A Pending JPH02110739A (en) 1988-10-20 1988-10-20 Central processing unit for multi-task

Country Status (1)

Country Link
JP (1) JPH02110739A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0424748A (en) * 1990-05-15 1992-01-28 Matsushita Electric Ind Co Ltd Parallel processing processor
JPH0477883A (en) * 1990-07-13 1992-03-11 Nec Ic Microcomput Syst Ltd Single chip microcomputer

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0424748A (en) * 1990-05-15 1992-01-28 Matsushita Electric Ind Co Ltd Parallel processing processor
JPH0477883A (en) * 1990-07-13 1992-03-11 Nec Ic Microcomput Syst Ltd Single chip microcomputer

Similar Documents

Publication Publication Date Title
JP2001265609A (en) Arithmetic processor
JP3970609B2 (en) Processor system
KR101838474B1 (en) Exception control in a multiprocessor system
JPH02110739A (en) Central processing unit for multi-task
JPH0916409A (en) Microcomputer
JPS62145435A (en) Microprocessor with concurrent processing instruction
JPH03288906A (en) Instruction executing system for pc
JPH0377137A (en) Information processor
JPS61182135A (en) Process selecting system
JP3022398B2 (en) Virtual computer system
JPH0628188A (en) Subroutine branching processing method
JPS63268032A (en) Loop control circuit
JPS6120139A (en) Interruption control system
JP2583614B2 (en) Vector arithmetic unit
JPH0544689B2 (en)
JPH0821027B2 (en) Microcomputer with built-in A / D converter
JPH0375832A (en) Virtual machine control system
JPS59173876A (en) Vector data processor
JPH0462093B2 (en)
JPS62296236A (en) Interruption processor for microprocessor
JPH04322332A (en) Program execution control system
JPH0883188A (en) Multitask processing computer
JPH0584546B2 (en)
JPS63214806A (en) Programmable controller
JPH0855034A (en) Arithmetic processor and interrupt processing system using the processor