JPH05210512A - Processor - Google Patents

Processor

Info

Publication number
JPH05210512A
JPH05210512A JP4281954A JP28195492A JPH05210512A JP H05210512 A JPH05210512 A JP H05210512A JP 4281954 A JP4281954 A JP 4281954A JP 28195492 A JP28195492 A JP 28195492A JP H05210512 A JPH05210512 A JP H05210512A
Authority
JP
Japan
Prior art keywords
bank
register
information
general
interrupt
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
Application number
JP4281954A
Other languages
Japanese (ja)
Other versions
JP3539984B2 (en
Inventor
Sanehiro Takiguchi
修弘 滝口
Soichi Kawasaki
壮一 川崎
Yasuo Yamada
泰生 山田
Akiyoshi Kanuma
安喜良 加沼
Toshiyuki Yaguchi
俊行 矢口
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP28195492A priority Critical patent/JP3539984B2/en
Publication of JPH05210512A publication Critical patent/JPH05210512A/en
Application granted granted Critical
Publication of JP3539984B2 publication Critical patent/JP3539984B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Memory System (AREA)

Abstract

(57)【要約】 【目的】 この発明は、割込み処理において使用できる
レジスタに制限を受けることなく、多重割込みを可能に
するとともに割込み処理に対する高速な応答性を達成し
得るプロセッサを提供することを目的とする。 【構成】 この発明は、プログラムの実行に係る特定の
情報を保持する専用レジスタ(6,7,8)と、プログ
ラムの実行に係る不特定の情報を保持する汎用レジスタ
(3)と、現在使用中のバンクを示す情報を保持する第
1のレジスタ(4)と、戻りバンクを示す情報を保持す
る第2のレジスタ(5)と、前記第2のレジスタと前記
専用レジスタ及び汎用レジスタに保持されたそれぞれの
情報が、外部バスを介することなく転送されるバンクを
複数セット備えたバンクメモリ(2)とから構成され
る。
(57) [Abstract] [Object] The present invention provides a processor capable of multiple interrupts and achieving high-speed responsiveness to interrupt processing without being restricted by the registers that can be used in interrupt processing. To aim. The present invention relates to a dedicated register (6, 7, 8) for holding specific information related to program execution, a general-purpose register (3) for holding unspecified information related to program execution, and a currently used register. A first register (4) holding information indicating a bank inside, a second register (5) holding information indicating a return bank, held in the second register, the dedicated register and a general-purpose register. Each piece of information is composed of a bank memory (2) having a plurality of banks to be transferred without passing through an external bus.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はバンク構造を有するプロ
セッサに関し、特に多重割込みに対応可能なプロセッサ
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a processor having a bank structure, and more particularly to a processor capable of handling multiple interrupts.

【0002】[0002]

【従来の技術】通常、マイクロプロセッサのCPU(中
央演算装置)中の汎用レジスタは、半導体チップの大き
さなどによって使用数の制限を受けている。そのため、
バンク構造と呼ばれる構造を持ったマイクロプロセッサ
がある。
2. Description of the Related Art Generally, the number of general purpose registers in a CPU (central processing unit) of a microprocessor is limited by the number of semiconductor chips used. for that reason,
There is a microprocessor having a structure called a bank structure.

【0003】バンクとは、汎用レジスタ(プログラム内
でおもに演算に用いる)の集まりである。一般に汎用レ
ジスタを格納する場合は、RAM(ランダムアクセスメ
モリ)の領域を、ある決められた大きさで区切られたス
ペース(バンクRAMと呼ぶ)に格納する。バンクを切
り換えることによって、いくつかのバンクRAMの中か
ら1つのバンクRAMを選択して、汎用レジスタの格納
や読み出しをすることができる。
A bank is a group of general-purpose registers (mainly used for calculation in a program). Generally, when storing a general-purpose register, an area of a RAM (random access memory) is stored in a space (called a bank RAM) divided by a predetermined size. By switching the bank, one bank RAM can be selected from among several bank RAMs to store and read general-purpose registers.

【0004】従来のマイクロプロセッサのうちで、バン
ク構造を持つものにおいては、バンクを切り換えること
により、汎用レジスタを多数持っていることと同等にな
る。例えば図9に示すように、マイクロプロセッサが、
1つのバンクにある汎用レジスタ101を4レジスタと
し、256バンク持っていれば、4×256=1024
個のレジスタを持っているのと同等になる。
Among conventional microprocessors, those having a bank structure are equivalent to having a large number of general-purpose registers by switching banks. For example, as shown in FIG. 9, the microprocessor
If the general-purpose register 101 in one bank is set to 4 registers and has 256 banks, 4 × 256 = 1024
It is equivalent to having registers.

【0005】バンクを複数持っている場合には、そのバ
ンクの番号を示すバンクポインタというレジスタが存在
する。そのレジスタの値を変更することにより、他のバ
ンクに格納している内容を現在使用できる汎用レジスタ
として取り扱うことができる。
When there are a plurality of banks, there is a register called a bank pointer which indicates the number of the bank. By changing the value of that register, the contents stored in another bank can be treated as a general-purpose register that can be used now.

【0006】従来のバンク構造を持っているマイクロプ
ロセッサシステムにおいては、割込みが発生したときに
使用していたバンク番号の退避先として、1)スタック
メモリ上、2)汎用レジスタ上が考えられている。両者
とも、割込みルーチンでバンクの切り換えが行われて
も、割込みルーチンが終わった後にそれぞれの退避先か
ら割込み前のバンク番号を読んでくるので、そのバンク
番号を見ることによって元のバンクに戻ることができ
る。
In a conventional microprocessor system having a bank structure, 1) stack memory and 2) general-purpose register are considered as save destinations of bank numbers used when an interrupt occurs. .. Even if the bank is switched in the interrupt routine, both of them read the bank number before the interrupt from each save destination after the interrupt routine ends, so you can return to the original bank by looking at the bank number. You can

【0007】[0007]

【発明が解決しようとする課題】バンク構造を持ってい
るマイクロプロセッサシステムのうち、割込みが発生し
たときに使用していたバンク番号をスタックメモリに退
避するものは、マイクロプロセッサの外部バスに接続さ
れた低速のスタックメモリへの書き込み(割込みが発生
したとき)、及び読み出し(割込みの処理から戻ると
き)を行う必要があり、時間がかかる。
Among the microprocessor systems having the bank structure, the one that saves the bank number used when the interrupt occurs in the stack memory is connected to the external bus of the microprocessor. Moreover, it is necessary to perform writing to the low-speed stack memory (when an interrupt occurs) and reading (when returning from the interrupt processing), which takes time.

【0008】一方、バンク構造を持っているマイクロプ
ロセッサシステムのうち、割込みが発生してバンクを切
り換えたときに、使用していたバンクのバンク番号をバ
ンク切り換え後の汎用レジスタに退避するものは、上記
のスタックメモリに退避する場合に比べて、外部バスへ
の低速なアクセスがないので、戻り情報となるバンク番
号の読み書きが速い。
On the other hand, among microprocessor systems having a bank structure, when a bank is switched due to an interrupt, the bank number of the bank being used is saved in a general-purpose register after the bank is switched. As compared with the case of saving in the stack memory described above, since there is no slow access to the external bus, reading and writing of the bank number which is the return information is faster.

【0009】しかし、バンク切り換え後の汎用レジスタ
を使って割込み処理を行うときには、戻り情報の入って
いる汎用レジスタを使用することができず、割込み処理
で使用できる汎用レジスタに制限ができてしまう。も
し、その汎用レジスタを使いたい場合には、スタックメ
モリなどに戻りバンク番号を退避しなければならなくな
る。このため、最初からスタックメモリに退避する方式
よりも遅くなる。
However, when the interrupt processing is performed using the general-purpose register after the bank switching, the general-purpose register containing the return information cannot be used and the general-purpose register that can be used in the interrupt processing can be limited. If you want to use that general-purpose register, you have to save the bank number by returning to a stack memory or the like. Therefore, it is slower than the method of saving to the stack memory from the beginning.

【0010】そこで、この発明は、上記に鑑みてなされ
たものであり、その目的とするところは、割込み処理に
おいて使用できるレジスタに制限を受けることなく、多
重割込みを可能にするとともに割込み処理に対する高速
な応答性を達成し得るプロセッサを提供することにあ
る。
Therefore, the present invention has been made in view of the above, and an object of the present invention is to enable multiple interrupts without being restricted by the registers that can be used in interrupt processing and to achieve high-speed interrupt processing. It is to provide a processor that can achieve high responsiveness.

【0011】[0011]

【課題を解決するための手段】上記目的を達成するため
に、この発明は、プログラムの実行に係る特定の情報を
保持する専用レジスタと、プログラムの実行に係る不特
定の情報を保持する汎用レジスタと、現在使用中のバン
クを示す情報と、戻りバンクを示す情報と、前記専用レ
ジスタ及び汎用レジスタに保持されている情報が、外部
バスを介することなく転送されるバンクを複数セット備
えたバンクメモリとから構成される。
In order to achieve the above object, the present invention provides a dedicated register for holding specific information related to program execution and a general-purpose register for holding unspecified information related to program execution. A bank memory having a plurality of banks to which the information indicating the currently used bank, the information indicating the return bank, and the information held in the dedicated register and the general-purpose register are transferred without passing through an external bus. Composed of and.

【0012】[0012]

【作用】上記構成において、この発明は、実行されるそ
れぞれの処理毎に、その処理で使用する専用レジスタと
汎用レジスタ及びその処理の前に実行されて未終了の処
理に対応したバンクの位置を示す情報を、それぞれ対応
したバンクに外部バスを介することなく転送して保持す
るようにしている。
In the above structure, according to the present invention, the dedicated register and general-purpose register used in the processing and the position of the bank corresponding to the unfinished processing executed before the processing are provided for each processing. The indicated information is transferred to and held in the corresponding bank without passing through the external bus.

【0013】[0013]

【実施例】以下、図面を用いてこの発明の実施例を説明
する。
Embodiments of the present invention will be described below with reference to the drawings.

【0014】図1はこの発明の第1の特徴の一実施例に
係るプロセッサの要部構成を示す図である。
FIG. 1 is a diagram showing a main configuration of a processor according to an embodiment of the first feature of the present invention.

【0015】図1は、半導体チップ全体のうち、本発明
にかかわるCPUコア1のバンクメモリ2の部分を抽出
拡大した図である。本来、半導体チップは、CPU1や
バンクメモリ2の他にシステムバスを通じて内蔵ROM
(図示せず)、タイマー(図示せず)やバスコントロー
ラ(図示せず)などを搭載している。これらの要素の間
では、システムバスを介してデータの受け渡しが行われ
る。チップ外とのデータの受け渡しは、さらにバスコン
トローラを介して行われる。内蔵ROMには、ユーザが
作成したプログラムの命令語が格納されている。内蔵R
OMはまた別のチップで実現してもよく、その場合は、
バスコントローラを介してシステムバスによってCPU
1とデータの受け渡しを行う。本明細書では、このシス
テムバスを外部バス、即ちCPUからみて外部という意
味で使用する。一方、本発明の特徴は、バンク切替の
際、汎用レジスタ3の内容をバンクメモリ2へ、CPU
1とバンクメモリ2を結ぶ専用バスを介して退避/復帰
を行うので、通常のデータの受け渡しを高速に行うこと
ができる。
FIG. 1 is an enlarged view of a portion of a bank memory 2 of a CPU core 1 according to the present invention in the entire semiconductor chip. Originally, the semiconductor chip has a built-in ROM through the system bus in addition to the CPU 1 and the bank memory 2.
(Not shown), a timer (not shown), a bus controller (not shown), etc. are mounted. Data is exchanged between these elements via the system bus. Data is exchanged with the outside of the chip via the bus controller. The built-in ROM stores the command words of the program created by the user. Built-in R
The OM may also be implemented on a separate chip, in which case
CPU via system bus via bus controller
Data is exchanged with 1. In this specification, this system bus is used to mean an external bus, that is, external to the CPU. On the other hand, the feature of the present invention is that the contents of the general-purpose register 3 are transferred to the bank memory 2 when the bank is switched.
Since saving / restoring is performed via a dedicated bus connecting 1 and the bank memory 2, normal data transfer can be performed at high speed.

【0016】図1において、プロセッサは、CPU1と
バンクメモリ2を備えている。CPU1は、16ビット
長の汎用レジスタRW0〜RW15からなる汎用レジス
タ群3と、カレントバンクポインタ(CBP)4、プレ
ビアスバンクポインタ(PBP)5、プログラムカウン
タ(PC)6、ユーザスタックポインタ(USP)7、
プロセッサステータスワード(PSW)8、及び図示し
ていないが割込みスタックポインタ(ISP)、特殊ス
タックポインタ(ESP)、コンディションコード(C
C)等の専用レジスタ群を備えている。
In FIG. 1, the processor includes a CPU 1 and a bank memory 2. The CPU 1 includes a general-purpose register group 3 including general-purpose registers RW0 to RW15 each having a 16-bit length, a current bank pointer (CBP) 4, a preliminary bank pointer (PBP) 5, a program counter (PC) 6, and a user stack pointer (USP). 7,
Processor status word (PSW) 8 and interrupt stack pointer (ISP), special stack pointer (ESP), condition code (C
A dedicated register group such as C) is provided.

【0017】カレントバンクポインタ(CBP)4は、
現在使用中のバンクの位置を示したレジスタである。プ
レビアスバンクポインタ(PBP)5は、現在使用中の
バンクから、現在使用中のバンクを用いて実行される処
理が終了した後に戻るべきバンクとなる戻りバンクの位
置を示したレジスタである。ただし、PBP5の値が
“0”ならば、スタックメモリに戻るべきバンクの位置
の情報が存在していることを示す。プログラムカウンタ
(PC)6は、プログラムの命令語が入っているメモリ
領域のアドレスを示すレジスタであり、プログラムが動
作していると、値が変化する。
The current bank pointer (CBP) 4 is
This is a register showing the position of the bank currently in use. The pre-deposited bank pointer (PBP) 5 is a register indicating the position of the return bank, which is the bank to be returned from the bank currently in use after the process executed using the bank currently in use is completed. However, if the value of PBP5 is "0", it indicates that there is information on the position of the bank to be returned to the stack memory. The program counter (PC) 6 is a register indicating an address of a memory area in which a command word of the program is stored, and its value changes when the program is operating.

【0018】割込みスタックポインタ(ISP)は割込
みから戻ってくる時のPC6、PSW8、PBP5、U
SP7の値が格納されているメモリ領域のアドレスを示
すレジスタである。ユーザスタックポインタ(USP)
とはユーザプログラムのサブルーチンから戻ってくる時
のPC6、PSW8、PBP5の値が格納されているメ
モリ領域のアドレスを示すレジスタである。特殊スタッ
クポインタ(ESP)は、システムコールから戻ってく
る時のPC6、PSW8、PBP5、USPの値が格納
されているメモリ領域のアドレスを示すレジスタであ
る。コンディションコード(CC)は、演算結果の状態
を示すフラグを格納しているレジスタである。プロセッ
サステータスワード(PSW)8は、マイクロプロセッ
サの状態を示すレジスタである。
The interrupt stack pointer (ISP) is PC6, PSW8, PBP5, U when returning from the interrupt.
It is a register indicating the address of the memory area in which the value of SP7 is stored. User stack pointer (USP)
Is a register indicating the address of the memory area in which the values of PC6, PSW8, and PBP5 are stored when returning from the subroutine of the user program. The special stack pointer (ESP) is a register indicating the address of the memory area in which the values of PC6, PSW8, PBP5, and USP when returning from the system call are stored. The condition code (CC) is a register that stores a flag indicating the state of the operation result. The processor status word (PSW) 8 is a register indicating the status of the microprocessor.

【0019】コンディションコードCCは図2に示すよ
うに、キャリーフラグC21(演算の結果、最上位ビッ
トから桁上げが発生したり、ボローが発生した場合に1
がセットされる)、オーバフローフラグV22(演算の
結果、オーバフローが発生したときに1がセットされ
る)、ゼロフラグZ23(演算の結果がゼロの時に1が
セットされる)、サインフラグS24(演算結果の最上
位ビットの値をコピーする)から構成される。
As shown in FIG. 2, the condition code CC is a carry flag C21 (1 when a carry occurs from the most significant bit or a borrow occurs as a result of the operation.
Is set), an overflow flag V22 (1 is set when an overflow occurs as a result of the operation), a zero flag Z23 (1 is set when the result of the operation is zero), a sign flag S24 (the operation result) The value of the most significant bit of is copied).

【0020】また、PSW8は図3に示すように、タス
クモードTM31(スタックポインタの指定)、バンク
サイズ(BS)32(現在使用中のバンクのサイズ)、
遅延割込みの指定(DI)33、特権モードの指定(R
G)34、シングルステップ動作の指定(SS)35、
割込み許可(EI)36、割込みマスク(IM)37、
コンディションコード(CC)21〜24の内容等の情
報が格納されている。図1に戻って、バンクメモリ2
は、プロセッサに内蔵されたRAM内に設けられてい
る。バンクメモリ2は、例えばバンク1〜バンク256
を備え、バンクi(i=1〜256)は4つの単位バン
クからなり4ワードの大きさを有している。このような
バンクメモリ2において、例えば汎用レジスタ群3は連
続したバンクに割り付けられ、PC6、PBP5、PS
W8、USP7からなる専用レジスタは1つのバンクに
割り付けられる。また、以下に説明する実施例にあって
は、図4に示すように、1バンクが4個のレジスタから
なる連続した4つのバンクのレジスタ群R0〜R15に
汎用レジスタ3を割り付け、PC6、PBP5、PSW
8、USP7からなる専用レジスタを1つのバンクの連
続した4つの単位バンクに割り付ける。このようにして
割り付けられるバンクと専用レジスタ群及び汎用レジス
タ群3とは、外部バスを介することなく高バンド幅でデ
ータ転送が行なわれるように接続構成されている。
As shown in FIG. 3, the PSW 8 has a task mode TM31 (designation of stack pointer), a bank size (BS) 32 (size of bank currently in use),
Delayed interrupt designation (DI) 33, privileged mode designation (R)
G) 34, designation of single step operation (SS) 35,
Interrupt enable (EI) 36, interrupt mask (IM) 37,
Information such as the contents of the condition codes (CC) 21 to 24 is stored. Returning to FIG. 1, the bank memory 2
Are provided in the RAM built in the processor. The bank memory 2 includes, for example, banks 1 to 256.
, The bank i (i = 1 to 256) is composed of four unit banks and has a size of 4 words. In such a bank memory 2, for example, the general-purpose register group 3 is allocated to consecutive banks, and PC6, PBP5, PS
The dedicated register consisting of W8 and USP7 is assigned to one bank. Further, in the embodiment described below, as shown in FIG. 4, the general-purpose register 3 is allocated to the register groups R0 to R15 of four consecutive banks each consisting of four registers, and the PC6 and PBP5 are allocated. , PSW
8, dedicated registers consisting of USP7 are allocated to four continuous unit banks of one bank. The banks allocated in this way, the dedicated register group and the general-purpose register group 3 are connected so that data can be transferred at a high bandwidth without using an external bus.

【0021】このような構成において、任意の時間にお
いてあるバンクを使用していたが、割込みが発生したこ
とによって割り込みルーチン(割込みの処理をするため
のプログラム)へ行き、バンクを切り換えた。その時
に、そのまま割込みルーチンへ行ったのでは、どこのバ
ンクへ戻るかわからなくなるので、PBP5を用意して
割込みルーチンでの処理が終了したときに使用するバン
クの位置(以下、戻りバンク番号とする)がわかるよう
にする。
In such a structure, a bank was used at an arbitrary time, but when an interrupt occurred, the bank was switched to an interrupt routine (a program for processing an interrupt). At that time, if it goes to the interrupt routine as it is, it is not known which bank to return to, so the position of the bank to be used when the processing in the interrupt routine is completed by preparing PBP5 (hereinafter referred to as the return bank number). ).

【0022】また、同時にCBP4を用意しておいて、
現在使用中のバンクの位置がわかるようにし、さらにバ
ンク切り換えが発生したときにCBP4の内容をPBP
5にロードすることにより戻りバンク番号を保存する。
バンクを戻すときは、PBP5の値をCBP4にロード
する。
At the same time, prepare CBP4,
The position of the bank currently in use can be known, and the contents of CBP4 can be changed to PBP when bank switching occurs.
Save the return bank number by loading into 5.
When returning the bank, the value of PBP5 is loaded into CBP4.

【0023】プログラム実行時に使用しているレジスタ
は、汎用レジスタ、PC6、ISP、USP7、ES
P、CBP4、PBP5、CC、PSW8がある。
Registers used during program execution are general-purpose registers, PC6, ISP, USP7, ES
There are P, CBP4, PBP5, CC, PSW8.

【0024】バンクRAMには図4に示した汎用レジス
タ群3、PC6、USP7、PSW8、PBP5を退避
するための領域(バンクエリア)が確保され、各バンク
に割り当てられる大きさが、それぞれ等しくなるように
区切られている。PBP5、PC6、USP7、PSW
8を退避するために1バンク、これらの専用レジスタを
用いた処理で使用している汎用レジスタ(4,8,1
2,16のいずれかのレジスタ数でそれぞれの処理内容
によって異なる)を退避するために、それぞれのレジス
タ数に対応した1から4バンクが必要になる。
An area (bank area) for saving the general-purpose register group 3, PC6, USP7, PSW8 and PBP5 shown in FIG. 4 is secured in the bank RAM, and the sizes assigned to the banks are equal to each other. Are separated. PBP5, PC6, USP7, PSW
1 bank for saving 8 and general-purpose registers (4, 8, 1) used in processing using these dedicated registers
1 to 4 banks corresponding to the respective numbers of registers are required in order to save 2 or 16 registers depending on the processing contents).

【0025】一方、サブルーチンに切り換えたときは、
切り換えられたルーチンはPBP5、PC6、USP
7、PSW8をスタックメモリ(後入れ先出し記憶装
置)(図示せず)に退避させる。
On the other hand, when switching to the subroutine,
The switched routines are PBP5, PC6, USP
7. The PSW 8 is saved in a stack memory (last-in first-out storage device) (not shown).

【0026】バンクを切り換える場合は、主に割込み処
理と、サブルーチンコールと、システムコールによるも
のにわけられる。
Switching between banks is mainly divided into interrupt processing, subroutine call, and system call.

【0027】割込み処理によってバンクを切り換える場
合には、まず割込み条件が成立して割込みが発生する
と,割込み要求信号を割込み制御回路に出力する。制御
回路は同時に受けた割込みの中で、優先度のいちばん高
いものをプロセッサに出力する。プロセッサは、発生し
た割込みが現在行なっている処理に比べて優先度が高
く、かつ割込みが許可されていれば、割込みを受け付
け、割込み制御回路に許可信号を出力する。
When switching banks by interrupt processing, first, when an interrupt condition is satisfied and an interrupt occurs, an interrupt request signal is output to the interrupt control circuit. The control circuit outputs to the processor the interrupt having the highest priority among the interrupts received at the same time. The processor receives the interrupt and outputs a permission signal to the interrupt control circuit if the generated interrupt has a higher priority than the processing currently being performed and the interrupt is permitted.

【0028】ただし、チップ外部からのノンマスカブル
割込みは割込みの許可、不許可にかかわらず、現在行な
っている処理に比べて優先度が高ければ割込みを受け付
け、許可信号を出力する。
However, the non-maskable interrupt from the outside of the chip accepts the interrupt and outputs the enable signal regardless of whether the interrupt is enabled or disabled if the priority is higher than that of the process currently being performed.

【0029】割込み制御回路は許可信号を受けて、その
割込み要求元に対応するベクタを発生し、そのベクタか
らマイクロプロセッサが割込み処理のスタートアドレス
を計算してその値をPC6に書き込む。
The interrupt control circuit receives the enable signal, generates a vector corresponding to the interrupt request source, the microprocessor calculates the start address of the interrupt process from the vector, and writes the value in the PC6.

【0030】割込み処理の開始時にスタートアドレスに
書いてある1ワードを読み込んで参照する。該1ワード
にはバンクを切り換えるか否かという情報と切り替える
バンク番号とがプログラムによって設定されている。該
1ワードを割込みモードワードと呼ぶ。
At the start of interrupt processing, one word written in the start address is read and referred to. Information indicating whether to switch the bank and a bank number to be switched are set in the 1 word by the program. The one word is called an interrupt mode word.

【0031】バンクを切り換えるときは、現バンクの内
容(汎用レジスタ群3、PC6、PSW8、USP7、
PBP5)をバンクRAMに退避し、CBP4の内容を
PBP5にロードし、CBP4には割込み処理で使用す
るバンク番号を格納する。このバンク番号で指定された
バンクRAMから汎用レジスタをロードして、バンクを
切り換え、割込み処理を開始する。
When switching banks, the contents of the current bank (general register group 3, PC6, PSW8, USP7,
PBP5) is saved in the bank RAM, the contents of CBP4 are loaded into PBP5, and the bank number used in interrupt processing is stored in CBP4. A general-purpose register is loaded from the bank RAM designated by this bank number, the bank is switched, and interrupt processing is started.

【0032】次に、サブルーチンコールによってバンク
を切り換える場合には、ユーザのプログラム中でCAL
L命令によってサブルーチンが呼び出される。USP7
が示すスタックメモリに現在使用しているバンクのPC
6、PBP5を退避し、スタックメモリに退避させたの
でPBPを“0”にし、CBP4はそのままにする。次
に、CALL命令で指定されたアドレスをPC6に書き
込み、サブルーチンの処理を開始する。
Next, when the bank is switched by a subroutine call, CAL is set in the user program.
The subroutine is called by the L instruction. USP7
PC of the bank currently used for the stack memory indicated by
6. Since PBP5 has been saved and saved in the stack memory, PBP is set to "0" and CBP4 remains unchanged. Next, the address designated by the CALL instruction is written in the PC 6, and the processing of the subroutine is started.

【0033】サブルーチンではバンクを切り換えないの
で、バンクを切り換えるときには、プログラムのCHG
BK命令(バンク切り換え命令)で行なう。そして、汎
用レジスタのみをバンクRAMに退避し、CBP4に新
しいバンク番号を書き込む。バンクを変えたがPBP5
は操作しない。バンクを切り換える際に、バンクを1か
ら3ずらせば、パラメータ受け渡し、結果受け取りが可
能になる。一方、4以上ずらすと、全く重なりの無いバ
ンク切り換えになる。
Since the bank is not switched in the subroutine, the CHG of the program must be switched when the bank is switched.
The BK instruction (bank switching instruction) is used. Then, only the general-purpose register is saved in the bank RAM, and a new bank number is written in CBP4. I changed the bank, but PBP5
Does not operate. When switching the banks, if the banks are shifted from 1 to 3, parameters can be passed and results can be received. On the other hand, if it is shifted by 4 or more, the banks will be switched without any overlap.

【0034】次に、システムコールによってバンクを切
り換える場合には、システムコール(ソフトウェア割込
み)はノンマスカブル割込みなので、割込みの許可、不
許可にかかわらず、割込みを受け付ける。割込み制御回
路によってその割込み処理に対応するベクタを発生し、
そのベクタから割込み処理のスタートアドレスを計算す
る。それと同時に、割り込まれた処理で使用していたP
C6、PBP5、PSW8をスタックメモリに書き込
み、スタックメモリに書き込んだためにPBPに“0”
をセットする。
Next, when the bank is switched by the system call, the system call (software interrupt) is a non-maskable interrupt, so that the interrupt is accepted regardless of whether the interrupt is enabled or disabled. Generate a vector corresponding to the interrupt processing by the interrupt control circuit,
The start address of interrupt processing is calculated from that vector. At the same time, P used in the interrupted process
Since C6, PBP5, and PSW8 are written in the stack memory and written in the stack memory, "0" is written in PBP.
Set.

【0035】次に、計算されたスタートアドレスをPC
6に書き込む。システムコールでは、通常の割込みの処
理のように自動的にバンクを切り換えないので、プログ
ラムでバンクの切り換えを行なう。バンクの切り換え
は、CHGBK命令(バンク切り換え命令)で行なう。
Next, the calculated start address is sent to the PC.
Write to 6. In system calls, banks are not automatically switched as in normal interrupt processing, so banks are switched by a program. Bank switching is performed by the CHGBK instruction (bank switching instruction).

【0036】まず、汎用レジスタのみをバンクRAMに
退避し、CBP4に新しいバンク番号を書き込む。PB
P5は操作しない。そして、システムコールの処理を行
なう。また、サブルーチンコールと同様、バンクを1か
ら3ずらせば、パラメータ受け渡し、結果受け取りが可
能になる。
First, only the general-purpose register is saved in the bank RAM, and a new bank number is written in CBP4. PB
Do not operate P5. Then, the system call is processed. Further, like the subroutine call, if the banks are shifted from 1 to 3, it becomes possible to pass parameters and receive results.

【0037】次に、割込みによるバンク切り換えから回
復する場合には、割込みの処理が終了し、RETI命令
(割込みからのリターン命令)によって元のバンクへ回
復する。CBP4にPBP5の内容をロードして、CB
P4が示すバンクRAMから汎用レジスタ3、PC6、
PBP5、PSW8、USP7をロードする。これによ
り、元のバンクへ回復できる。
Next, when recovering from bank switching due to an interrupt, interrupt processing is completed, and the original bank is recovered by a RETI instruction (return instruction from interrupt). Load the contents of PBP5 into CBP4 and
From the bank RAM indicated by P4 to the general-purpose register 3, PC6,
Load PBP5, PSW8, USP7. As a result, the original bank can be restored.

【0038】ただし、次回に同じ割込みが入ったときに
続きを実行した時など、割込み処理で使用した汎用レジ
スタなどの内容を保存する必要がある場合には、戻る前
にその内容をバンクRAMに書き戻す命令をプログラム
で行なう。
However, if it is necessary to save the contents of the general-purpose registers used in the interrupt processing such as when the continuation is executed when the same interrupt is input next time, the contents are stored in the bank RAM before returning. Write back instructions in a program.

【0039】次に、サブルーチンコールによるバンク切
り換えから回復する場合には、サブルーチンコールの処
理が終了し、プログラムのCHGBK命令(バンク切り
換え命令)によってサブルーチン中の元のバンクへ戻
す。CBP4にプログラムで切り換える前のCBP4の
値を書き込み、CBP4が示すバンクRAMから汎用レ
ジスタ3のみをロードする。これにより、元のバンクへ
回復できる。
Next, when recovering from the bank switching by the subroutine call, the processing of the subroutine call is finished, and the program is returned to the original bank in the subroutine by the CHGBK instruction (bank switching instruction). The value of CBP4 before being switched by the program is written in CBP4, and only the general purpose register 3 is loaded from the bank RAM indicated by CBP4. As a result, the original bank can be restored.

【0040】次に、RET命令(サブルーチンからの戻
り命令)によって元のルーチンへ回復する。PBP5が
“0”なので、USP7が示すスタックメモリからPC
6、PBP5をロードする。その際に、バンクの重なり
を1から3に設定すれば、結果の受け渡しが可能であ
る。
Next, the original routine is restored by the RET instruction (return instruction from the subroutine). Since PBP5 is "0", the stack memory indicated by USP7
6. Load PBP5. At that time, if the bank overlap is set to 1 to 3, the results can be passed.

【0041】次に、システムコールによるバンク切り換
えから回復する場合には、システムコールの処理が終了
し、CHGBK命令(バンク戻し命令)によって元のバ
ンクへ回復する。CBP4にプログラムで切り換える前
のCBP4の値を書き込み、CBP4が示すバンクRA
Mから汎用レジスタ3のみをロードする。これにより、
元のバンクへ回復できる。RETI(割込みルーチンか
らの戻り命令)命令によって元のルーチンへ回復する。
PBP5が“0”なので、USP7が示すスタックメモ
リからPC6、PBP5、PSW8をロードする。そし
て、元のルーチンへ戻ることができる。
Next, when recovering from the bank switching by the system call, the processing of the system call is completed, and the original bank is recovered by the CHGBK instruction (bank return instruction). The value of CBP4 before switching by the program is written to CBP4, and the bank RA indicated by CBP4 is written.
Only general register 3 is loaded from M. This allows
You can recover to the original bank. The RETI (return instruction from interrupt routine) instruction restores the original routine.
Since PBP5 is "0", PC6, PBP5 and PSW8 are loaded from the stack memory indicated by USP7. Then, the original routine can be returned to.

【0042】また、サブルーチンコールや、システムコ
ールによってバンクを切り換える場合には、切り換えた
レジスタバンクにパラメータを受け渡すことができるこ
とは上述した通りである。バンクを切り換える際にレジ
スタバンクを重ねてバンク番号を設定すると、汎用レジ
スタに入っているパラメータを受け渡すことが可能にな
る。
As described above, when a bank is switched by a subroutine call or a system call, parameters can be transferred to the switched register bank. When register banks are overlapped and bank numbers are set when switching banks, parameters stored in general-purpose registers can be passed.

【0043】すなわち、汎用レジスタ同志が重なった部
分の間でパラメータの受け渡しを行うことができる。こ
のため、スタックメモリなどを介さずに直接行えるの
で、時間が短縮される。ただし、受け渡しは、元のレジ
スタバンクのレジスタ番号と新しいバンクのレジスタ番
号が異なることになる。
That is, parameters can be passed between the portions where the general-purpose registers overlap each other. For this reason, the time can be shortened because the process can be performed directly without using a stack memory or the like. However, in the delivery, the register number of the original register bank and the register number of the new bank differ.

【0044】次に、図5及び図6を用いてバンク切り換
えの一実施例を説明する。
Next, an embodiment of bank switching will be described with reference to FIGS.

【0045】図5はバンクの一使用例を示す図であり、
図6はバンク切り換え時の処理の流れを示す図である。
FIG. 5 is a diagram showing an example of use of a bank,
FIG. 6 is a diagram showing the flow of processing at the time of bank switching.

【0046】ここで、システムコール1はバンクを切り
換えず、サブルーチン2はシステムコール2とする。ま
た、使用中のPBP5が“0”の時は、PC6、PBP
5、PSW8がスタックに退避していることを示す。
Here, the system call 1 does not switch the bank, and the subroutine 2 is the system call 2. When PBP5 in use is "0", PC6, PBP
5 indicates that the PSW 8 is saved in the stack.

【0047】まずはじめに、メインルーチンが実行され
ている。この時には、CBP4には使用しているバンク
の番号の15、PBP5には初期化されて“0”が入っ
ている。PC6、PBP5、USP7、PSW8を格納
するバンクはバンク15、汎用レジスタ3を格納するバ
ンクRAMはバンク16から19を使用している。
First, the main routine is executed. At this time, the CBP 4 has the bank number 15 being used, and the PBP 5 has been initialized to "0". Banks 15 for storing the PC 6, PBP 5, USP 7, and PSW 8 are used for the bank, and banks 16 to 19 are used for the bank RAM for storing the general-purpose register 3.

【0048】次に、サブルーチン1がコールされると、
今まで使用していたバンクのPC6、PBP5をスタッ
クメモリに退避し、スタックメモリに退避したのでPB
Pに“0”をセットする。サブルーチンコール命令によ
って指定されたプログラム番地をPC6にセットする。
プログラムによって使用するバンクを15から12へ切
り換える。使用していた汎用レジスタ3の内容をバンク
16から19に退避する。CBP4に12をセットし、
汎用レジスタにバンク13から16までの値をロードす
る。先のメインルーチンで使用していたバンク16のR
0からR3までのレジスタを、サブルーチン1のR12
からR15へ直接パラメータを受け渡すことが出来る。
Next, when subroutine 1 is called,
The PC6 and PBP5 of the bank that has been used up to now are saved in the stack memory and saved in the stack memory.
Set "0" to P. The program address designated by the subroutine call instruction is set in the PC 6.
The bank used by the program is switched from 15 to 12. The contents of the used general-purpose register 3 are saved in the banks 16 to 19. Set CBP4 to 12,
The general registers are loaded with the values of banks 13-16. R of bank 16 used in the previous main routine
Registers 0 to R3 are stored in R12 of subroutine 1
Parameters can be directly passed from R15 to R15.

【0049】次に、割込みルーチン1が発生すると、ル
ーチン1の開始時に予めプログラムで設定済みのスター
トアドレスにある1ワードを読んで、割込みルーチン1
で使用するバンク番号と大きさを読み込む。これと同時
に、サブルーチン1の汎用レジスタはバンク13から1
6、PC6、PSW8、USP7、PBP5はバンク1
2へ退避し、CBP4の内容の12をPBP5にロード
する。
Next, when the interrupt routine 1 is generated, at the start of the routine 1, one word at the start address preset by the program is read and the interrupt routine 1 is read.
Read the bank number and size used in. At the same time, the general-purpose registers of subroutine 1 are stored in banks 13 to 1
6, PC6, PSW8, USP7, PBP5 is bank 1
Save to 2 and load 12 of the contents of CBP4 into PBP5.

【0050】PC6に割込みルーチン1に対応するスタ
ートアドレスを書き込み、CBP4には割込みルーチン
1で使用するバンク番号の1を入れて、バンクを切り換
える。バンク2とバンク3から汎用レジスタをロードし
て使用する。
The start address corresponding to the interrupt routine 1 is written in the PC 6, the bank number 1 used in the interrupt routine 1 is entered in the CBP 4, and the bank is switched. General purpose registers are loaded from bank 2 and bank 3 for use.

【0051】次に、割込みルーチン2が発生すると、割
込みルーチン1の場合と同様に、ルーチンの始めに予め
プログラムで設定済みのスタートアドレスにある1ワー
ドを読んで、割込みルーチン2で使用するバンク番号と
大きさを読み込む。それと同時に、割込みルーチン1の
汎用レジスタはバンク2から3、PC6、PSW8、U
SP7、PBP5はバンク1へ退避し、CBP4の内容
の1をPBP5にロードする。
Next, when the interrupt routine 2 is generated, as in the case of the interrupt routine 1, at the beginning of the routine, one word at the start address preset by the program is read and the bank number used in the interrupt routine 2 is read. And read the size. At the same time, the general-purpose registers of interrupt routine 1 are banks 2 to 3, PC6, PSW8, and U.
SP7 and PBP5 are saved in bank 1 and the content 1 of CBP4 is loaded into PBP5.

【0052】PC6に割込みルーチン2に対応するスタ
ートアドレスを書き込み、CBP4には割込みルーチン
2で使用するバンク番号の8を入れて、バンクを切り換
える。汎用レジスタをバンク9からロードして使用す
る。
The start address corresponding to the interrupt routine 2 is written in the PC 6, the bank number 8 used in the interrupt routine 2 is entered in the CBP 4, and the bank is switched. General purpose registers are loaded from bank 9 and used.

【0053】次に、割込みルーチン2の処理が終了する
と、割込みルーチン2からのリターン命令が発生し、C
BP4にPBP5の値の1をロードする。バンク1から
PC6、PBP=12、PSW8、USP7をロード
し、バンク2とバンク3から汎用レジスタをロードし、
元のバンクへ回復する。そして、割込みルーチン1の処
理の続きを行なう。
Next, when the processing of the interrupt routine 2 is completed, a return instruction from the interrupt routine 2 is generated, and C
Load BP4 with the value 1 of PBP5. Load PC6, PBP = 12, PSW8, USP7 from bank 1, load general registers from bank 2 and bank 3,
Restores the original bank. Then, the processing of the interrupt routine 1 is continued.

【0054】次に、割込みルーチン1の処理が終了する
と、割込みルーチン1からのリターン命令が発生し、割
込みルーチン2の処理が終了したのと同様に、CBP4
にPBP5の値の12をロードする。バンク12からP
C6、PBP=0、PSW8、USP7をロードし、バ
ンク13からバンク16までを汎用レジスタにロード
し、元のバンク12へ回復する。そして、サブルーチン
1の処理の続きを行なう。
Next, when the processing of the interrupt routine 1 is completed, a return instruction from the interrupt routine 1 is generated, and the CBP 4 is processed in the same manner as the processing of the interrupt routine 2 is completed.
Load the value 12 of PBP5 to. Bank 12 to P
C6, PBP = 0, PSW8, USP7 are loaded, banks 13 to 16 are loaded into general-purpose registers, and the original bank 12 is restored. Then, the processing of subroutine 1 is continued.

【0055】次に、サブルーチン1の処理の途中で、シ
ステムコール2が発生して、これを受け付けると、サブ
ルーチン1で使用していたPC6、PSW8、PBP=
0をスタックメモリに退避する。次に、そのソフトウェ
ア割込みルーチンに対応するスタートアドレスをPC6
に書き込む。
Next, when a system call 2 is generated in the middle of the processing of the subroutine 1 and is accepted, the PC 6, PSW 8 and PBP used in the subroutine 1 =
0 is saved in the stack memory. Next, the start address corresponding to the software interrupt routine is set to PC6.
Write in.

【0056】ソフトウェア割込みは自動的にバンクを切
り換えないので、CBP4の値は12で変わらない。ス
タックメモリに退避したので、PBPには“0”をセッ
トする。プログラムでバンクを切り換えて、CBP=1
0にする。汎用レジスタをバンク11とバンク12から
ロードして使用する。
Since the software interrupt does not automatically switch banks, the value of CBP4 remains at 12. Since it is saved in the stack memory, "0" is set in PBP. Programmatically switch banks, CBP = 1
Set to 0. General purpose registers are loaded from banks 11 and 12 and used.

【0057】次に、システムコール2の処理の途中で、
割込みルーチン3が発生すると、割込みルーチン2の場
合と同様に、ルーチンの始めに予めプログラムで設定済
みのスタートアドレスにある1ワードを読んで、割込み
ルーチン3で使用するバンク番号と大きさを読み込む。
それと同時に、システムコール2の汎用レジスタはバン
ク11から12、PC6、PSW8、USP7、PBP
=0はバンク10へ退避し、CBP4の内容の10をP
BP5にロードする。
Next, during the processing of the system call 2,
When the interrupt routine 3 occurs, as in the case of the interrupt routine 2, one word at the start address preset by the program is read at the beginning of the routine, and the bank number and size used in the interrupt routine 3 are read.
At the same time, the general-purpose registers of system call 2 are banks 11 to 12, PC6, PSW8, USP7, PBP.
= 0 saves to bank 10 and writes 10 of CBP4 contents to P
Load it into BP5.

【0058】PC6には割込みルーチンに対応するスタ
ートアドレスを書き込み、CBPには割込みルーチン3
で使用するバンク番号の4を入れて、バンクを切り換え
る。汎用レジスタはバンク5から7をロードして使用す
る。
The start address corresponding to the interrupt routine is written in PC6, and the interrupt routine 3 is written in CBP.
Insert the bank number 4 used in step 2 to switch the bank. Banks 5 to 7 are loaded and used as general-purpose registers.

【0059】次に、割込みルーチン3の処理中にシステ
ムコール1が発生して、これを受け付けると、割込みル
ーチン3で使用していたPC6、PSW8、PBP=1
0をスタックメモリに退避する。次に、そのソフトウェ
ア割込みルーチンに対応するスタートアドレスをPC6
に書き込む。
Next, when the system call 1 is generated during the processing of the interrupt routine 3 and is accepted, PC6, PSW8, PBP = 1 used in the interrupt routine 3 are used.
0 is saved in the stack memory. Next, the start address corresponding to the software interrupt routine is set to PC6.
Write in.

【0060】ソフトウェア割込みは自動的にバンクを切
り換えないので、CBP4の値は変わらない。スタック
メモリに退避したので、PBPは“0”をセットする。
システムコール1はバンク切り換えを行わないので、C
BP=4のままとなり、汎用レジスタはそのままバンク
5から7を使用する。
The value of CBP4 does not change because the software interrupt does not automatically switch banks. Since it is saved in the stack memory, PBP is set to "0".
System call 1 does not switch banks, so C
BP remains 4, and general-purpose registers use banks 5 to 7 as they are.

【0061】次に、システムコール1の処理が終了する
と、割込みからの復帰命令によって割込みルーチン3に
戻る。PBPは“0”なので、スタックメモリから割込
みルーチン3で使用していたPC6、PSW8、PBP
=10をロードする。バンクは切り換えていないので、
CBP4の値は4で変わらず、汎用レジスタはそのまま
バンク5から7を使用し、割込みルーチン3の処理を再
開する。
Next, when the processing of the system call 1 is completed, it returns to the interrupt routine 3 by the return instruction from the interrupt. Since PBP is "0", PC6, PSW8, PBP used in interrupt routine 3 from the stack memory
= 10 is loaded. Since the banks have not been switched,
The value of CBP4 remains unchanged at 4, and the general purpose registers use banks 5 to 7 as they are, and the processing of the interrupt routine 3 is restarted.

【0062】次に、割込みルーチン3の処理が終了する
と、割込みルーチン3からのリターン命令が発生し、C
BP4にPBP5の値の10をロードする。バンク10
からPC6、PBP=0、PSW8、USP7をロード
し、バンク11とバンク12から汎用レジスタをロード
し、元のバンク10へ回復する。そして、システムコー
ル2の続きを行なう。
Next, when the processing of the interrupt routine 3 is completed, a return instruction from the interrupt routine 3 is generated and C
Load BP4 with the value of 10 for PBP5. Bank 10
To PC6, PBP = 0, PSW8, and USP7 are loaded, general registers are loaded from banks 11 and 12, and the original bank 10 is restored. Then, the system call 2 is continued.

【0063】次に、システムコール2の処理が終了する
と、プログラムのバンク切り換え命令によってCBPへ
12をロードして、バンク12へ回復させる。PBP=
0なので、スタックメモリからPC6、PBP=0、P
SW8をロードする。汎用レジスタにバンク13からバ
ンク16までをロードし、再びサブルーチン1の処理を
行なう。
Next, when the processing of the system call 2 is completed, 12 is loaded into the CBP by the bank switching instruction of the program, and the bank 12 is restored. PBP =
Since it is 0, PC6, PBP = 0, P from the stack memory
Load SW8. Banks 13 to 16 are loaded into the general-purpose registers, and the processing of subroutine 1 is performed again.

【0064】次に、サブルーチン1の処理が終了する
と、プログラムによってCBP4に15をロードし、バ
ンクを戻す。PBP=0なので、スタックメモリからP
C6、PBP=0をロードする。汎用レジスタにバンク
16からバンク19までをロードし、メインルーチンの
続きを再開する。
Next, when the processing of the subroutine 1 is completed, the program loads 15 into the CBP 4 and returns the bank. Since PBP = 0, P from the stack memory
Load C6, PBP = 0. Banks 16 to 19 are loaded into the general-purpose registers, and the continuation of the main routine is restarted.

【0065】なお、CBPの示す値と、PBPの示す値
の両方を保持するレジスタを設けるようにしてもよい。
このように、本発明では、戻りバンク番号のアクセスの
際に、低速な外部バスを介してスタックメモリにアクセ
スしないですむので、割込みに対して高速な応答性を持
つことができる。
A register for holding both the value indicated by CBP and the value indicated by PBP may be provided.
As described above, according to the present invention, when accessing the return bank number, it is not necessary to access the stack memory via the low-speed external bus, so that it is possible to have a high-speed responsiveness to an interrupt.

【0066】また、PCやPSW等の専用レジスタを複
数セット設けることなく、多重割込みに対応することが
可能となり、かつ、高速な割込み応答/復帰が可能とな
る。さらに、戻りバンク番号を保持しているレジスタの
値によって、戻りバンク番号を格納する場所の選択がで
きるので、高速な応答を必要としない割込みの際の戻り
バンク番号を外部のスタックメモリに置くこともでき、
内部にあるバンクのRAMを効率的に使うことができ
る。例えば割込み1が応答しているときに、同一の汎用
レジスタを利用する割込み2が発生した場合、割込み2
で使用するPC、PSWをバンクに書き込んでしまうの
で、割込み1で使用していたPC、PSWをスタックメ
モリに退避することができ、また、スタックメモリに置
くことによってバンクメモリを節約することもできる。
Further, it is possible to cope with multiple interrupts without providing a plurality of sets of dedicated registers such as PCs and PSWs, and high-speed interrupt response / recovery is possible. In addition, the location of the return bank number can be selected by the value of the register holding the return bank number, so the return bank number for interrupts that do not require a fast response should be placed in the external stack memory. Can also
The RAM of the internal bank can be used efficiently. For example, if interrupt 2 that uses the same general-purpose register occurs while interrupt 1 is responding, interrupt 2
Since the PC and PSW used in step 1 are written in the bank, the PC and PSW used in interrupt 1 can be saved in the stack memory, and the bank memory can be saved by placing them in the stack memory. ..

【0067】次に、本発明の第2の特徴に係る実施例を
説明する。この実施例の特徴は、前述した実施例のPB
Pを持つことのかわりに、戻りバンク番号を格納するた
めに1バンク使用することにある。
Next, an embodiment according to the second feature of the present invention will be described. The feature of this embodiment is that the PB of the above-mentioned embodiment is used.
Instead of having P, it consists in using one bank to store the return bank number.

【0068】ここで、1バンクは、図4に示すようにレ
ジスタが4個から構成され、連続する1から4バンクを
汎用レジスタとして使用し、PC6、PSW8、USP
7を退避するために1バンク使用する。
Here, one bank is composed of four registers as shown in FIG. 4, and consecutive one to four banks are used as general-purpose registers. PC6, PSW8, USP
1 bank is used to save 7.

【0069】任意の時間においてあるバンクを使用して
いたが、割込みが発生したことによって割り込みルーチ
ン(割込みの処理をするためのプログラム)へ行き、バ
ンクを切り換えた。その時に、そのまま割込みルーチン
へ行ったのでは、どこのバンクへ戻るかわからなくなる
ので、バンクRAMに戻りバンク番号を格納してわかる
ようにする。
Although a bank was used at an arbitrary time, when an interrupt occurred, an interrupt routine (a program for processing an interrupt) was visited to switch the bank. At that time, if it goes to the interrupt routine as it is, it is not known which bank to return to, so the bank number is stored in the bank RAM so that the bank number can be known.

【0070】また、同時にCBP4を用意しておいて、
現在使用中のバンクの位置がわかるようにする。さらに
バンク切り換えが発生したとき、切り換えた先の戻りバ
ンク番号を格納するバンクRAMにCBP4をロードす
ることにより終了後に戻るバンクの位置を保存する。逆
に、CBP4にロードすれば、バンクを戻すことができ
る。
At the same time, prepare CBP4,
Make sure you know the location of the bank currently in use. Further, when bank switching occurs, CBP4 is loaded into the bank RAM that stores the return bank number of the switching destination, and the position of the bank to be returned after the end is saved. Conversely, the bank can be returned by loading it into CBP4.

【0071】一方、サブルーチンに切り換えたときは、
切り換えられたルーチンはPC6、USP7、PSW8
をスタックメモリ(後入れ先出し記憶装置)に退避させ
る。バンクを切り換える場合は、主に割込み処理と、サ
ブルーチンコールと、システムコールによるものにわけ
られる。
On the other hand, when switching to the subroutine,
The switched routines are PC6, USP7, PSW8
Are saved in the stack memory (last-in first-out storage device). Switching between banks is mainly divided into interrupt processing, subroutine call, and system call.

【0072】割込み処理によってバンクを切り換える場
合には、まず割込み条件が成立して割込みが発生すると
割込み要求信号を割込み制御回路に出力する。制御回路
は同時に受けた割込みの中で、優先度のいちばん高いも
のをプロセッサに出力する。プロセッサは、発生した割
込みが現在行なっている処理に比べて優先度が高く、か
つ割込みが許可されていれば、割込みを受け付け、割込
み制御回路に許可信号を出力する。
When switching banks by interrupt processing, first, when an interrupt condition is satisfied and an interrupt occurs, an interrupt request signal is output to the interrupt control circuit. The control circuit outputs to the processor the interrupt having the highest priority among the interrupts received at the same time. The processor receives the interrupt and outputs a permission signal to the interrupt control circuit if the generated interrupt has a higher priority than the processing currently being performed and the interrupt is permitted.

【0073】ただし、チップ外部からのノンマスカブル
割込みは割込みの許可、不許可にかかわらず、現在おこ
なっているルーチンに比べて優先度が高ければ割込みを
受け付け、許可信号を出力する。
However, the non-maskable interrupt from the outside of the chip accepts the interrupt and outputs the enable signal regardless of whether the interrupt is permitted or not, if the priority is higher than that of the routine which is currently being performed.

【0074】割込み制御回路は許可信号を受けて、その
割込み要求元に対応するベクタを発生し、そのベクタか
らマイクロプロセッサが割込みルーチンのスタートアド
レスを計算してその値をPC6に書き込む。
The interrupt control circuit receives the enable signal, generates a vector corresponding to the interrupt request source, the microprocessor calculates the start address of the interrupt routine from the vector, and writes the value in the PC6.

【0075】処理の始めにスタートアドレスに書いてあ
る1ワードを読んで、バンクを切り換えるか否かを選択
する。この1ワードはプログラムによって設定してお
く。
At the beginning of the process, one word written in the start address is read to select whether to switch the bank. This one word is set by the program.

【0076】バンクを切り換えるときは、現バンクの内
容(汎用レジスタ3、PC6、PSW8、USP7)を
バンクRAMに退避し、CBP4の内容を割込みルーチ
ンで使用するバンクに、戻りバンク番号としてロード
し、CBP4には割込みルーチンで使用するバンク番号
を入れる。このバンク番号で指定されたバンクRAMか
ら汎用レジスタ3をロードして、バンクを切り換え、割
込み処理を開始する。
When switching the bank, the contents of the current bank (general-purpose register 3, PC6, PSW8, USP7) are saved in the bank RAM, and the contents of CBP4 are loaded as the return bank number into the bank used in the interrupt routine. The bank number used in the interrupt routine is put in CBP4. The general-purpose register 3 is loaded from the bank RAM designated by this bank number, the bank is switched, and interrupt processing is started.

【0077】次に、サブルーチンコールによってバンク
を切り換える場合には、ユーザのプログラム中でCAL
L命令によってサブルーチンが呼び出される。USP7
が示すスタックメモリに現在使用しているバンクのPC
6を退避し、スタックメモリに退避させたのでバンクに
ある戻りバンク番号を“0”にし、CBP4はそのまま
にする。次に、CALL命令で指定されたアドレスをP
C6に書き込み、サブルーチンの処理を開始する。
Next, when the bank is switched by a subroutine call, CAL is set in the user program.
The subroutine is called by the L instruction. USP7
PC of the bank currently used for the stack memory indicated by
Since 6 has been saved and saved in the stack memory, the return bank number in the bank is set to "0" and CBP4 remains unchanged. Next, set the address specified by the CALL instruction to P
Write to C6 and start the processing of the subroutine.

【0078】プログラムでバンクを切り換えるときは、
CHGBK命令(バンク切り換え命令)で行なう。汎用
レジスタのみをバンクRAMに退避し、CBP4に新し
いバンク番号を書き込む。バンクを変えたが、PBP5
は操作しない。そして、ルーチンの処理を行なう。その
際に、バンクを1から3ずらせば、パラメータ受け渡
し、結果受け取りが可能になる。一方、4以上ずらす
と、全く重なりの無いバンク切り換えになる。
When switching banks by program,
The CHGBK instruction (bank switching instruction) is used. Only the general-purpose register is saved in the bank RAM, and a new bank number is written in CBP4. I changed the bank, but PBP5
Does not operate. Then, routine processing is performed. At that time, if the banks are shifted from 1 to 3, the parameters can be passed and the results can be received. On the other hand, if it is shifted by 4 or more, the banks will be switched without any overlap.

【0079】次に、システムコールによってバンクを切
り換える場合には、システムコール(ソフトウェア割込
み)はノンマスカブル割込みなので、割込みの許可、不
許可にかかわらず、割込みを受け付ける。割込み制御回
路によってその割込みルーチンに対応するベクタを発生
し、そのベクタから割込みルーチンのスタートアドレス
を計算する。それと同時に、割り込まれたルーチンで使
用していたPC6、PSW8をスタックメモリに書き込
み、スタックメモリに書き込んだために戻りバンク番号
に0をセットする。
Next, when the bank is switched by the system call, the system call (software interrupt) is a non-maskable interrupt, and therefore the interrupt is accepted regardless of whether the interrupt is enabled or disabled. The interrupt control circuit generates a vector corresponding to the interrupt routine, and calculates the start address of the interrupt routine from the vector. At the same time, the PC6 and PSW8 used in the interrupted routine are written in the stack memory, and the return bank number is set to 0 because they were written in the stack memory.

【0080】次に、計算されたスタートアドレスをPC
6に書き込む。システムコールでは、通常の割込みのル
ーチンのように自動的にバンクを切り換えないので、プ
ログラムでバンクの切り換えを行なう。バンクの切り換
えは、CHGBK命令(バンク切り換え命令)で行な
う。まず、汎用レジスタのみをバンクRAMに退避し、
CBP4に新しいバンク番号を書き込む。PBP5は操
作しない。そして、ルーチンの処理を行なう。また、サ
ブルーチンコールと同様、バンクを1から3ずらせば、
パラメータ受け渡し、結果受け取りが可能になる。
Next, the calculated start address is set to the PC
Write to 6. Since the system call does not automatically switch banks as in the normal interrupt routine, the bank is switched by the program. Bank switching is performed by the CHGBK instruction (bank switching instruction). First, save only the general-purpose registers in the bank RAM,
Write a new bank number to CBP4. Do not operate PBP5. Then, routine processing is performed. Also, like the subroutine call, if you shift the bank from 1 to 3,
Parameters can be passed and results can be received.

【0081】次に、割込みによるバンク切り換えから回
復する場合には、割込みの処理が終了すると、RETI
命令(割込みからのリターン命令)によって元のバンク
へ回復する。CBP4へバンクにある戻りバンク番号の
内容をロードして、CBP4が示すバンクRAMから汎
用レジスタ3、PC6、PSW8、USP7をロードす
る。これにより、元のバンクへ回復できる。
Next, when recovering from bank switching due to an interrupt, when the interrupt processing is completed, RETI
An instruction (return instruction from interrupt) restores the original bank. The contents of the return bank number in the bank are loaded into CBP4, and the general-purpose register 3, PC6, PSW8, and USP7 are loaded from the bank RAM indicated by CBP4. As a result, the original bank can be restored.

【0082】ただし、次回に同じ割込みが入ったときに
続きを実行したい時など、割込みルーチンで使用した汎
用レジスタなどの内容を保持する必要がある場合には、
戻る前にその内容をバンクRAMに書き戻す命令をプロ
グラムで行なう。
However, when it is necessary to retain the contents of the general-purpose registers used in the interrupt routine, for example, when the same interrupt is input next time and the continuation is to be executed,
The program issues an instruction to write the contents back to the bank RAM before returning.

【0083】次に、サブルーチンコールによるバンク切
り換えから回復する場合には、サブルーチンコールの処
理が終了すると、プログラムのCHGBK命令(バンク
切り換え命令)によってサブルーチン中の元のバンクへ
戻す。CBP4にプログラムで切り換える前のCBP4
の値を書き込み、CBP4の示すバンクRAMから汎用
レジスタのみをロードする。これにより、元のバンクへ
回復できる。
Next, in the case of recovering from bank switching by a subroutine call, when the processing of the subroutine call is completed, the program is returned to the original bank in the subroutine by the CHGBK instruction (bank switching instruction). CBP4 before switching to CBP4 by program
Value is written and only the general-purpose register is loaded from the bank RAM indicated by CBP4. As a result, the original bank can be restored.

【0084】次に、RET命令(サブルーチンからの戻
り命令)によって元のルーチンへ回復する。戻りバンク
番号が“0”なので、USP7が示すスタックメモリか
らPC6をロードする。その際に、バンクの重なりを1
から3に設定すれば、結果の受け渡しが可能である。
Next, the original routine is restored by the RET instruction (return instruction from the subroutine). Since the return bank number is "0", PC6 is loaded from the stack memory indicated by USP7. At that time, the bank overlap is 1
If it is set from 3 to 3, the result can be passed.

【0085】次に、システムコールによるバンク切り換
えから回復する場合には、システムコールの処理が終了
すると、CHGBK命令(バンク戻し命令)によって元
のバンクへ回復する。CBP4にプログラムで切り換え
る前のCBP4の値を書き込み、CBP4の示すバンク
RAMから汎用レジスタのみをロードする。これによ
り、元のバンクへ回復できる。RETI(割込みルーチ
ンからの戻り命令)命令によって元のルーチンへ回復す
る。戻りバンク番号が“0”なので、USP7が示すス
タックメモリからPC6、PSW8をロードする。そし
て、元のルーチンへ戻ることができる。
Next, when recovering from bank switching by a system call, when the system call processing is completed, the original bank is recovered by a CHGBK instruction (bank return instruction). The value of CBP4 before being switched by the program is written in CBP4, and only the general-purpose register is loaded from the bank RAM indicated by CBP4. As a result, the original bank can be restored. The RETI (return instruction from interrupt routine) instruction restores the original routine. Since the return bank number is "0", PC6 and PSW8 are loaded from the stack memory indicated by USP7. Then, the original routine can be returned to.

【0086】次に、CBP4が処理が終了後に使用すべ
きバンクの位置を示している値を格納しているバンクの
位置を指定した実施例を、図7及び図8を用いて説明す
る。図7はバンクの一使用例であり、図8はバンク切り
換え時の処理の流れを示す図である。
Next, an embodiment in which the position of the bank in which the CBP 4 stores the value indicating the position of the bank to be used after the processing is completed will be described with reference to FIGS. 7 and 8. FIG. 7 is an example of using one bank, and FIG. 8 is a diagram showing a flow of processing when switching banks.

【0087】ここで、システムコール1はバンクを切り
換えず、サブルーチン2はシステムコール2とする。ま
た、CBP4から1を引いた値が指示するバンクに戻り
バンク番号を格納する。戻りバンク番号が“0”の時
は、PC6、PSW8がスタックメモリに退避している
ことを示す。
Here, the system call 1 does not switch the bank, and the subroutine 2 is the system call 2. Also, the bank number is stored in the bank indicated by the value obtained by subtracting 1 from CBP4. When the return bank number is "0", it indicates that the PC6 and PSW8 are saved in the stack memory.

【0088】まずはじめに、メインルーチンが実行され
ている。この時には、CBP4には使用しているバンク
の番号の15、バンク14にある戻りバンク番号には初
期化されて“0”が入っている。PC6、USP7、P
SW8を格納するバンクはバンク15、汎用レジスタ3
を格納するバンクRAMはバンク16から19を使用し
ている。
First, the main routine is executed. At this time, the number 15 of the bank being used is in the CBP 4, and the return bank number in the bank 14 is initialized to "0". PC6, USP7, P
The bank for storing SW8 is bank 15, general-purpose register 3
Banks 16 to 19 are used as the bank RAM for storing

【0089】次に、サブルーチン1がコールされると、
今まで使用していたバンクのPC6、バンク14にある
戻りバンク番号をスタックメモリに退避し、スタックメ
モリに退避したのでバンク14にある戻りバンク番号に
“0”をセットする。サブルーチンコール命令によって
指定されたプログラム番地をPC6にセットする。プロ
グラムによって使用するバンクを15から13へ切り換
える。使用していた汎用レジスタの内容をバンク16か
ら19に退避する。バンク14にあった戻りバンク番号
の“0”をバンク12にロードする。CBPに13をセ
ットし、汎用レジスタにバンク14から16までの値を
ロードする。
Next, when subroutine 1 is called,
The return bank numbers in the banks PC6 and 14 of the bank that have been used up to now are saved in the stack memory, and since they have been saved in the stack memory, "0" is set to the return bank number in the bank 14. The program address designated by the subroutine call instruction is set in the PC 6. The bank used by the program is switched from 15 to 13. The contents of the used general-purpose register are saved in the banks 16 to 19. The return bank number “0” that was in the bank 14 is loaded into the bank 12. CBP is set to 13 and general registers are loaded with the values of banks 14-16.

【0090】先のメインルーチンで使用していたバンク
16のR0からR3までのレジスタを、サブルーチン1
のR8からR11へ直接、パラメータを受け渡すことが
出来る。
Registers R0 to R3 of bank 16 used in the above main routine are stored in subroutine 1
Parameters can be passed directly from R8 to R11.

【0091】次に、割込みルーチン1が発生すると、ル
ーチン1の始めに予めプログラムで設定済みのスタート
アドレスにある1ワードを読んで、割込みルーチン1で
使用するバンク番号と大きさを読み込む。これと同時
に、サブルーチン1の汎用レジスタはバンク14から1
6、PC6、PSW8、USP7はバンク13へ退避
し、CBP4の内容の13をバンク1にある戻りバンク
番号にロードする。
Next, when the interrupt routine 1 occurs, at the beginning of the routine 1, one word at the start address preset by the program is read, and the bank number and size used in the interrupt routine 1 are read. At the same time, the general-purpose registers of subroutine 1 are stored in banks 14 to 1
6, PC6, PSW8, USP7 are saved to bank 13 and 13 of the contents of CBP4 is loaded into the return bank number in bank 1.

【0092】PC6に割込みルーチンに対応するスター
トアドレスを書き込み、CBP4には割込みルーチン1
で使用するバンク番号の2を入れて、バンクを切り換え
る。バンク3から汎用レジスタをロードして使用する。
The start address corresponding to the interrupt routine is written in PC6, and the interrupt routine 1 is written in CBP4.
Insert the bank number 2 used in step 2 to switch the bank. A general purpose register is loaded from bank 3 and used.

【0093】次に、割込みルーチン2が発生すると、割
込みルーチン1の場合と同様に、ルーチンの始めに、予
めプログラムで設定済みのスタートアドレスにある1ワ
ードを読んで、割込みルーチン2で使用するバンク番号
と大きさを読み込む。これと同時に、割込みルーチン1
の汎用レジスタはバンク3、PC6、PSW8、USP
7はバンク2へ退避し、CBP4の内容の2をバンク8
にある戻りバンク番号にロードする。
Next, when the interrupt routine 2 is generated, as in the case of the interrupt routine 1, at the beginning of the routine, one word at the start address preset by the program is read and the bank used in the interrupt routine 2 is read. Read the number and size. At the same time, interrupt routine 1
General-purpose registers are bank 3, PC6, PSW8, USP
7 is saved in bank 2, and 2 of the contents of CBP4 is saved in bank 8
Load the return bank number in.

【0094】PC6に割込みルーチンに対応するスター
トアドレスを書き込み、CBP4には割込みルーチン2
で使用するバンク番号の9を入れて、バンクを切り換え
る。汎用レジスタをバンク10からロードして使用す
る。
The start address corresponding to the interrupt routine is written in PC6, and the interrupt routine 2 is written in CBP4.
Insert the bank number 9 used in step 1 to switch the bank. General purpose registers are loaded from bank 10 and used.

【0095】次に、割込みルーチン2の処理が終了する
と、割込みルーチン2からのリターン命令が発生し、C
BP4にバンク8にある戻りバンク番号の値の2をロー
ドする。バンク2からPC6、PSW8、USP7をロ
ードし、バンク3から汎用レジスタをロードし、元のバ
ンクへ回復する。バンク1にある戻りバンク番号は13
が入っている。そして、割込みルーチン1の処理の続き
を行なう。
Next, when the processing of the interrupt routine 2 is completed, a return instruction from the interrupt routine 2 is generated and C
Load BP4 with the value 2 of the return bank number in bank 8. PC6, PSW8, USP7 are loaded from bank 2, general-purpose registers are loaded from bank 3, and the original bank is restored. The return bank number in bank 1 is 13
Is included. Then, the processing of the interrupt routine 1 is continued.

【0096】次に、割込みルーチン1の処理が終了する
と、割込みルーチン1からのリターン命令が発生し、割
込みルーチン1の処理が終了したのと同様に、CBP4
にバンク1にある戻りバンク番号の値の13をロードす
る。バンク13からPC6、PSW8、USP7をロー
ドし、バンク14からバンク16までを汎用レジスタに
ロードし、元のバンク13へ回復する。バンク12にあ
る戻りバンク番号は“0”が入っている。そして、サブ
ルーチン1の処理の続きを行なう。
Next, when the processing of the interrupt routine 1 is completed, a return instruction from the interrupt routine 1 is generated, and the CBP 4 is generated in the same manner as the processing of the interrupt routine 1 is completed.
The value 13 of the return bank number in bank 1 is loaded into. PC6, PSW8, and USP7 are loaded from bank 13, banks 14 to 16 are loaded into general-purpose registers, and the original bank 13 is restored. The return bank number in bank 12 contains "0". Then, the processing of subroutine 1 is continued.

【0097】次に、サブルーチン1の処理の途中で、シ
ステムコール2が発生して、これを受け付けると、サブ
ルーチン1で使用していたPC6、PSW8、バンク1
2にある戻りバンク番号の値の“0”をスタックメモリ
に退避する。次に、そのソフトウェア割込みルーチンに
対応するスタートアドレスをPC6に書き込む。
Next, when a system call 2 is generated during the processing of the subroutine 1, and this is accepted, the PC 6, PSW 8 and bank 1 used in the subroutine 1 are accepted.
The value "0" of the return bank number in 2 is saved in the stack memory. Then, the start address corresponding to the software interrupt routine is written in the PC 6.

【0098】ソフトウェア割込みは自動的にバンクを切
り換えないので、CBP4の値は13で変わらない。ス
タックメモリに退避したので、バンク12にある戻りバ
ンク番号は“0”をセットする。プログラムでバンクを
切り換えて、CBP4を13から12にする。バンク1
2にあった戻りバンク番号の“0”をバンク11にロー
ドする。汎用レジスタをバンク13からロードして使用
する。
Since the software interrupt does not automatically switch banks, the value of CBP4 remains unchanged at 13. Since it has been saved in the stack memory, the return bank number in bank 12 is set to "0". Programmatically switch banks to change CBP4 from 13 to 12. Bank 1
The return bank number “0” that was in 2 is loaded into the bank 11. The general purpose register is loaded from the bank 13 and used.

【0099】次に、システムコール2の処理の途中で、
割込みルーチン3が発生すると、割込みルーチン2の場
合と同様に、ルーチンの始めに予めプログラムで設定済
みのスタートアドレスにある1ワードを読んで、割込み
ルーチン3で使用するバンク番号と大きさを読み込む。
これと同時に、システムコール2の汎用レジスタはバン
ク13、PC6、PSW8、USP7はバンク12へ退
避し、CBP4の内容の12をバンク4にある戻りバン
ク番号にロードする。
Next, during the processing of the system call 2,
When the interrupt routine 3 occurs, as in the case of the interrupt routine 2, one word at the start address preset by the program is read at the beginning of the routine, and the bank number and size used in the interrupt routine 3 are read.
At the same time, the general-purpose register of the system call 2 is saved in the bank 13, PC6, PSW8, and USP7 in the bank 12, and 12 of the contents of the CBP4 is loaded into the return bank number in the bank 4.

【0100】PC6には割込みルーチンに対応するスタ
ートアドレスを書き込み、CBP4には割込みルーチン
3で使用するバンク番号の5を入れて、バンクを切り換
える。汎用レジスタはバンク6から7をロードして使用
する。
The start address corresponding to the interrupt routine is written in PC6, the bank number 5 used in interrupt routine 3 is entered in CBP4, and the bank is switched. General purpose registers are used by loading banks 6 to 7.

【0101】次に、割込みルーチン3の処理中にシステ
ムコール1が発生して、これを受け付けると、割込みル
ーチン3で使用していたPC6、PSW8、バンク4に
ある戻りバンク番号の12をスタックメモリに退避す
る。次に、そのソフトウェア割込みルーチンに対応する
スタートアドレスをPC6に書き込む。
Next, when the system call 1 is generated during the processing of the interrupt routine 3 and is accepted, the return bank number 12 in the PC 6, PSW 8 and bank 4 used in the interrupt routine 3 is stored in the stack memory. Evacuate to. Then, the start address corresponding to the software interrupt routine is written in the PC 6.

【0102】ソフトウェア割込みは自動的にバンクを切
り換えないので、CBP4の値は5で変わらない。スタ
ックメモリに退避したので、バンク4にある戻りバンク
番号は“0”をセットする。汎用レジスタはそのままバ
ンク6から7を使用する。
The value of CBP4 does not change at 5 because the software interrupt does not automatically switch banks. Since it is saved in the stack memory, the return bank number in bank 4 is set to "0". The general purpose registers use banks 6 to 7 as they are.

【0103】次に、システムコール1の処理が終了する
と、割込みからの復帰命令によって割込みルーチン3に
戻る。バンク4にある戻りバンク番号は“0”なので、
スタックメモリから割込みルーチン3で使用していたP
C6、PSW8をロードし、バンク4に戻りバンク番号
の12をロードする。バンクは切り換えていないので、
CBP4の値は5で変わらず、汎用レジスタはそのまま
バンク6から7を使用し、割込みルーチン3の処理を再
開する。
Next, when the processing of the system call 1 is completed, it returns to the interrupt routine 3 by the return instruction from the interrupt. Since the return bank number in bank 4 is "0",
P used in interrupt routine 3 from stack memory
C6 and PSW8 are loaded, the bank 4 is returned, and the bank number 12 is loaded. Since the banks have not been switched,
The value of CBP4 remains unchanged at 5, the general purpose registers use banks 6 to 7 as they are, and the processing of the interrupt routine 3 is restarted.

【0104】次に、割込みルーチン3の処理が終了する
と、割込みルーチン3からのリターン命令が発生し、C
BP4にバンク4にある戻りバンク番号の値の12をロ
ードする。バンク12からPC6、PSW8、USP7
をロードし、バンク13から汎用レジスタをロードし、
元のバンク12へ回復する。バンク11にある戻りバン
ク番号は“0”が入っている。そして、システムコール
2の続きを行なう。
Next, when the processing of the interrupt routine 3 is completed, a return instruction from the interrupt routine 3 is generated and C
Load BP4 with the value 12 of the return bank number in bank 4. Bank 12 to PC6, PSW8, USP7
Load general registers from bank 13,
Restores the original bank 12. The return bank number in bank 11 contains "0". Then, the system call 2 is continued.

【0105】次に、システムコール2の処理が終了する
と、プログラムのバンク切り換え命令によってCBPを
12から13に変えて、バンク13に戻す。バンク11
にある戻り番号の“0”をバンク12にロードする。バ
ンク12にある戻りバンク番号は“0”なので、スタッ
クメモリからPC6、PSW8、バンク12にある戻り
番号の“0”をバンク12にロードする。汎用レジスタ
にバンク14からバンク16までをロードし、再びサブ
ルーチン1の処理を行なう。
Then, when the processing of the system call 2 is completed, the CBP is changed from 12 to 13 by the bank switching instruction of the program and is returned to the bank 13. Bank 11
Load the return number “0” in the bank 12 into the bank 12. Since the return bank number in bank 12 is "0", PC6, PSW8, and the return number "0" in bank 12 are loaded from the stack memory into bank 12. Banks 14 to 16 are loaded into the general-purpose registers, and the processing of subroutine 1 is performed again.

【0106】次に、サブルーチン1の処理が終了する
と、プログラムによってCBP4を13から15に変
え、バンク15に戻す。バンク12にあった戻り番号の
“0”をバンク14にロードする。バンク14にある戻
りバンク番号は“0”なので、スタックメモリからPC
6、バンク14にある戻りバンク番号の“0”をバンク
14にロードする。汎用レジスタにバンク16からバン
ク19までをロードし、メインルーチンの続きを再開す
る。
Next, when the processing of the subroutine 1 is completed, the CBP 4 is changed from 13 to 15 by the program and is returned to the bank 15. The return number “0” in the bank 12 is loaded in the bank 14. The return bank number in bank 14 is "0",
6. The return bank number "0" in the bank 14 is loaded into the bank 14. Banks 16 to 19 are loaded into the general-purpose registers, and the continuation of the main routine is restarted.

【0107】このように、PBPを設けずPBPに格納
する内容を算出してバンクメモリに直接転送するように
しても、前述した実施例と同様の効果が得られる。ま
た、PBP5のレジスタが不要となり、構成の簡略化を
図ることができる。
As described above, even if the PBP is not provided and the contents to be stored in the PBP are calculated and directly transferred to the bank memory, the same effect as that of the above-described embodiment can be obtained. Further, the register of the PBP5 is unnecessary, and the configuration can be simplified.

【0108】さらに、通常は、データの受け渡しはシス
テムバスを介して行われるが、本発明によれば、CPU
コアとバンクメモリ2とがシステムバスとは別の専用バ
スで接続されている。そのため、バンク切り替えの際、
汎用レジスタ3及び専用レジスタの内容を該専用バスを
介してバンクメモリ2へ退避/復帰するので、高速なデ
ータの転送が実現できる。また、該専用バスの幅を広く
することによって(64ビット、128ビツト)、さら
に高速なバンク切り替えが可能になる。
Further, normally, data is passed through the system bus, but according to the present invention, the CPU
The core and the bank memory 2 are connected by a dedicated bus other than the system bus. Therefore, when switching banks,
Since the contents of the general-purpose register 3 and the dedicated register are saved / restored in the bank memory 2 via the dedicated bus, high-speed data transfer can be realized. Further, by widening the width of the dedicated bus (64 bits, 128 bits), faster bank switching becomes possible.

【0109】前記第2実施例をさらに効率良く動作させ
るため、以下第3実施例〜第5実施例を図10〜図12
に示す。
In order to operate the second embodiment more efficiently, the third to fifth embodiments will be described below with reference to FIGS.
Shown in.

【0110】第1及び第2実施例に比して、第3〜第5
実施例では、PC6やPSW8などの専用レジスタを指
すポインタと汎用レジスタを指すポインタを別々にもつ
ことに特徴がある。
Compared with the first and second embodiments, the third to fifth embodiments
The embodiment is characterized by having a pointer that points to a dedicated register such as the PC 6 and the PSW 8 and a pointer that points to a general-purpose register separately.

【0111】図10Aは本発明による第3実施例に基づ
くプロセッサの構成を示している。第3実施例では、新
たに、PC6及びPSW8を退避するバンクを指すSB
P(スペシャルバンクポインタ)10が備えられてい
る。図10及び図10Cを使って動作を説明する。CB
P4及びSBP10は命令及び割込によって書き換えら
れる。命令で書き換える時は、CBP4及びSBP10
を同時に書き換えられる専用の命令が必要である。これ
をCCBP(チェンジカレントバンクポインタ)命令と
名付ける。CCBP命令のオペランドとしてCBP4及
びSBP10の2つが必要である。CBP4とSBP1
0をLOAD命令等で別々に書き換えこともできるが、
その場合には、CBP4とSBP10の両方を書き換え
るまで割込みは禁止にしなければならないので効率が悪
くなる。一方、割り込みで書き換える時は、割り込みテ
ーブル中の割り込みモードワードに新しいCBP4及び
SBP10の値を記述しておく。
FIG. 10A shows the structure of a processor according to the third embodiment of the present invention. In the third embodiment, SB is newly designated as a bank for saving the PC 6 and PSW 8.
A P (special bank pointer) 10 is provided. The operation will be described with reference to FIGS. 10 and 10C. CB
P4 and SBP10 are rewritten by instructions and interrupts. When rewriting by command, CBP4 and SBP10
Dedicated instructions that can be rewritten simultaneously are required. This is named CCBP (Change Current Bank Pointer) instruction. Two CBP4 and SBP10 are required as operands of the CCBP instruction. CBP4 and SBP1
0 can be rewritten separately by LOAD command etc.,
In that case, since the interrupt must be prohibited until both CBP4 and SBP10 are rewritten, the efficiency becomes poor. On the other hand, when rewriting with an interrupt, new values of CBP4 and SBP10 are described in the interrupt mode word in the interrupt table.

【0112】次に、ず10Cを使って、本実施例に於
て、汎用レジスタ3の本数を越えるレジスタを使用中に
割り込みが発生した時の動作を説明する。
Next, the operation when an interrupt occurs while using a register exceeding the number of general-purpose registers 3 in this embodiment will be described by using 10C.

【0113】CBP4及びSBP10の初期設定は、割
り込み時には割込みモードワードにより、そして命令に
よりタスクチェンジ時には、CCBP命令により行う。
割込み処理やタクス内に於て、汎用レジスタ3の本数を
越えるワークレジスタが必要になるとLOAD命令でC
BP4を書き換えて汎用レジスタ3の内容を更新する。
さらに、ここで新たな割込みが発生した場合には、初
ず、汎用レジスタ3の内容をCBP4で指示されるバン
クに退避し、そしてPC6C及びPSW8をSBP10
で指示されるバンクに退避する。
Initialization of the CBP4 and the SBP10 is performed by the interrupt mode word at the time of interruption and by the CCBP instruction at the time of task change by an instruction.
If more work registers than the number of general-purpose registers 3 are required for interrupt processing or in the task, C is issued by the LOAD instruction.
The contents of the general-purpose register 3 are updated by rewriting the BP4.
Furthermore, when a new interrupt occurs here, the contents of the general-purpose register 3 are first saved in the bank designated by CBP4, and the PC6C and PSW8 are set to SBP10.
Save to the bank specified by.

【0114】図11は本発明による第4実施例に基づく
プロセッサの構成を示している。
FIG. 11 shows the structure of a processor according to the fourth embodiment of the present invention.

【0115】第4実施例では、レジスタのワーク領域の
ベース位置のバンクを指すBBP(ベースバンクポイン
タ)12及び、割込みが発生するときにPC6とPSW
8を退避するバンクメモリーと該BBP12との距離で
あるところの相対値を保持するDSR(ディスタントト
ゥペシャルレジスタ)14を備えていることに特徴があ
る。図11B及び図11Cを使って第4実施例の動作を
説明する。CBP4,BBP12及びDSR14は命令
及び割込みで書き換えられる。命令で書き換える時は、
CBP4,BBP12及びDSR14は同時に書き換え
られる専用の命令が必要である。これをCBBP(チェ
ンジ ベース バンク ポインタ)命令と名付ける。C
BBP命令のオペランドとしてBBP12及びDSR1
4を指定しておき、CBP4にはBBP12と同じ値を
ロードする。一方、割り込みによって書き換える場合
は、割り込みテーブルの割込みモードワードに新しいB
BP12およびDSRの値を記述しておく。
In the fourth embodiment, a BBP (base bank pointer) 12 pointing to the bank at the base position of the work area of the register, and the PC 6 and PSW when an interrupt occurs.
It is characterized in that it has a DSR (distant to special register) 14 for holding a relative value which is a distance between the bank memory for saving 8 and the BBP 12. The operation of the fourth embodiment will be described with reference to FIGS. 11B and 11C. The CBP4, BBP12 and DSR14 are rewritten by an instruction and an interrupt. When rewriting with an instruction,
The CBP4, BBP12, and DSR14 require dedicated instructions that are simultaneously rewritten. This is called a CBBP (change base bank pointer) instruction. C
BBP12 and DSR1 as operands of BBP instruction
4 is specified, and the same value as BBP12 is loaded into CBP4. On the other hand, when rewriting by an interrupt, a new B is written in the interrupt mode word of the interrupt table.
The values of BP12 and DSR are described.

【0116】次に、図11Cを使って、本実施例に於
て、汎用レジスタ3の本数を越えるレジスタを使用中に
割込みが発生した時の動作を説明する。
Next, with reference to FIG. 11C, the operation when an interrupt occurs while using a register exceeding the number of general-purpose registers 3 in this embodiment will be described.

【0117】BBP12,CBP4及びDSR14の初
期設定は、割込み時には割込みモードによって、また、
命令によるタスクチェンジの時にはCBBP命令によっ
て行う。割込み時やタスク内に於て、汎用レジスタ3の
本数を越えるレジスタが必要になるとLOAD命令でC
BP4を書き換えて汎用レジスタ3の内容を更新する。
さらに、ここで新たな割込みが発生した場合には、初
ず、汎用レジスタ3の内容をCBP4で指されるバンク
に退避し、そしてPC6及びPSW8をBBP12及び
DSR14で指されるバンクに退避する。その結果、第
4実施例では第3実施例に比してオペランドの長さを短
くできる利点がある。一方、レジスタの数は第4実施例
の方が多くなってしまい、またPC6及びPSW8の退
避/復帰の際、BBP12及びDSR14からの情報を
合わせて計算を行う分だけ余分に時間がかかる。
The initial setting of BBP12, CBP4 and DSR14 depends on the interrupt mode at the time of interrupt, and
When the task is changed by a command, the CBBP command is used. At the time of an interrupt or in a task, if more registers than the number of general-purpose registers 3 are needed, the LOAD instruction will be issued
The contents of the general-purpose register 3 are updated by rewriting the BP4.
Furthermore, when a new interrupt occurs here, the contents of the general-purpose register 3 are first saved in the bank pointed to by CBP4, and the PC6 and PSW8 are saved in the bank pointed by BBP12 and DSR14. As a result, the fourth embodiment has an advantage that the length of the operand can be shortened as compared with the third embodiment. On the other hand, the number of registers is larger in the fourth embodiment, and when saving / restoring the PC 6 and the PSW 8, it takes extra time for the calculation by combining the information from the BBP 12 and the DSR 14.

【0118】図12に示す第5実施例では、第4実施例
に於けるCBP4の代わりにBBPからCBP4までの
距離の情報を保持するDCR(ディスタント・トウ・C
BPレジスタ)が設けられている。このような構成によ
って、第5実施例では、第3及び第4実施例よりもさら
にオペランドの長さを短くすることができる。また、第
5実施例ではレジスタの数は第4実施例に比して少なく
することができる。
In the fifth embodiment shown in FIG. 12, instead of the CBP4 in the fourth embodiment, a DCR (distant toe C) which holds information on the distance from the BBP to the CBP4 is used.
BP register) is provided. With such a structure, the length of the operand can be further shortened in the fifth embodiment than in the third and fourth embodiments. Further, the number of registers in the fifth embodiment can be reduced as compared with the fourth embodiment.

【0119】[0119]

【発明の効果】以上説明したように、この発明は、バン
クを切り換えた際に戻りバンクの位置を示す情報及び専
用レジスタと汎用レジスタの情報を外部バスを介するこ
となく転送して退避するバンクをバンクメモリに複数セ
ット設けるようにしたので、割込み処理等で使用できる
汎用レジスタに制限を受けることなく、割込み処理の応
答/復帰を高速に行なうことが可能となる。
As described above, according to the present invention, when the bank is switched, the information indicating the position of the return bank and the information of the dedicated register and the general-purpose register are transferred and saved without passing through the external bus. Since a plurality of sets are provided in the bank memory, the response / recovery of the interrupt processing can be performed at high speed without being restricted by the general-purpose register that can be used in the interrupt processing and the like.

【0120】また、退避領域を複数セット設けることに
よって多重割込みに対応することができる。
By providing a plurality of sets of save areas, it is possible to deal with multiple interrupts.

【0121】さらに、専用レジスタの内容を退避する領
域を選択するようにしたので、バンクメモリを効率的に
利用することができる。
Further, since the area for saving the contents of the dedicated register is selected, the bank memory can be efficiently used.

【0122】さらに、PCやPSWなどの専用レジスタ
の内容を退避するバンクをタスクごとに指定でき、また
専用レジスタと汎用レジスタを指すポインタが別々に用
意されているので、バンクチェンジによる汎用レジスタ
の更新が高速に実行でき、また、タスク内やタスク間で
該バンクを共有できるため、バンクメモリの使用効率が
向上する。
Furthermore, a bank for saving the contents of a dedicated register such as PC or PSW can be designated for each task, and pointers pointing to the dedicated register and the general-purpose register are prepared separately, so that the general-purpose register is updated by a bank change. Can be executed at high speed, and the bank can be shared within a task or between tasks, so that the bank memory can be used more efficiently.

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

【図1】この発明の第1の特徴の一実施例に係るプロセ
ッサの要部構成を示す図である。
FIG. 1 is a diagram showing a main configuration of a processor according to an embodiment of a first feature of the present invention.

【図2】コンディションコードの一構成例を示す図であ
FIG. 2 is a diagram showing a configuration example of a condition code.

【図3】プロセッサステータスワードの一構成例を示す
図である。
FIG. 3 is a diagram showing a configuration example of a processor status word.

【図4】バンクRAMに格納するレジスタ群の構成を示
す図である。
FIG. 4 is a diagram showing a configuration of a register group stored in a bank RAM.

【図5】この発明の第1の特徴に係る実施例のバンクの
使用例を示す図である。
FIG. 5 is a diagram showing an example of use of a bank of an embodiment according to the first feature of the present invention.

【図6】図5に示すバンクの使用例におけるバンク切り
換え時の処理の流れを示す図である。
FIG. 6 is a diagram showing a flow of processing at the time of bank switching in the usage example of the bank shown in FIG. 5;

【図7】この発明の第2の特徴に係る実施例のバンクの
使用例を示す図である。
FIG. 7 is a diagram showing a usage example of a bank of an embodiment according to the second feature of the present invention.

【図8】図7に示すバンクの使用例におけるバンク切り
換え時の処理の流れを示す図である。
8 is a diagram showing a flow of processing at the time of bank switching in the usage example of the bank shown in FIG.

【図9】従来のプロセッサにおけるバンク群の構成を示
す図である。
FIG. 9 is a diagram showing a configuration of a bank group in a conventional processor.

【図10】この発明の第3の特徴に係る実施例のバンク
の使用例及び動作を示す図である。
FIG. 10 is a diagram showing a usage example and an operation of the bank of the embodiment according to the third feature of the present invention.

【図11】この発明の第4の特徴に係る実施例のバンク
の使用例及び動作を示す図である。
FIG. 11 is a diagram showing a usage example and an operation of the bank of the embodiment according to the fourth feature of the present invention.

【図12】この発明の第5の特徴に係る実施例のバンク
の使用例及び動作を示す図である。
FIG. 12 is a diagram showing a usage example and an operation of the bank of the embodiment according to the fifth feature of the present invention.

【符号の説明】 1 CPU 2 バンクメモリ 3 汎用レジスタ群 4 カレントバンクポインタ(CBP) 5 プレビアスバンクポインタ(PBP) 6 プログラムカウンタ(PC) 7 ユーザスタックポインタ(USP) 8 プロセッサステータスワード(PSW) 10 スペシャルバンクポインタ(SBP) 12 ベースバンクポインタ(BBP) 14 ディスタントトゥスペシャルレジスタ(DSR) 16 ディスタントトゥCBPレジスタ(DCR)[Explanation of Codes] 1 CPU 2 Bank memory 3 General-purpose register group 4 Current bank pointer (CBP) 5 Previous bank pointer (PBP) 6 Program counter (PC) 7 User stack pointer (USP) 8 Processor status word (PSW) 10 Special bank pointer (SBP) 12 Base bank pointer (BBP) 14 Distant to special register (DSR) 16 Distant to CBP register (DCR)

フロントページの続き (72)発明者 加沼 安喜良 神奈川県川崎市幸区堀川町580番1号 株 式会社東芝半導体システム技術センター内 (72)発明者 矢口 俊行 神奈川県川崎市幸区堀川町580番1号 株 式会社東芝半導体システム技術センター内Front Page Continuation (72) Inventor Kanuma Akira 580-1 Horikawa-cho, Sachi-ku, Kawasaki-shi, Kanagawa Inside the Toshiba Semiconductor System Technology Center (72) Inventor Toshiyuki Yaguchi 580, Horikawa-cho, Kawasaki-shi, Kanagawa No. 1 Stock Company Toshiba Semiconductor System Technology Center

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 プログラムの実行に係る特定の情報を保
持する専用レジスタと、 プログラムの実行に係る不特定の情報を保持する汎用レ
ジスタと、 現在使用中のバンクを示す情報と、戻りバンクを示す情
報と、前記専用レジスタ及び汎用レジスタに保持されて
いる情報が、外部バスを介することなく転送されるバン
クを複数セット備えたバンクメモリとを有することを特
徴とするプロセッサ。
1. A dedicated register for holding specific information related to program execution, a general-purpose register for holding unspecified information related to program execution, information indicating a bank currently in use, and a return bank. A processor comprising: information and a bank memory having a plurality of banks to which information held in the dedicated register and the general-purpose register is transferred without passing through an external bus.
【請求項2】 プログラムの実行に係る特定の情報を保
持する専用レジスタと、 プログラムの実行に係る不特定の情報を保持する汎用レ
ジスタと、 現在使用中のバンクを示す情報を保持する第1のレジス
タと、 戻りバンクを示す情報を保持する第2のレジスタと、 前記第2のレジスタと前記専用レジスタ及び汎用レジス
タに保持されたそれぞれの情報が、外部バスを介するこ
となく転送されるバンクを複数セット備えたバンクメモ
リとを有することを特徴とするプロセッサ。
2. A dedicated register for holding specific information related to program execution, a general-purpose register for holding unspecified information related to program execution, and a first register for holding information indicating a bank currently in use. A register, a second register that holds information indicating a return bank, and a plurality of banks to which the respective information held in the second register, the dedicated register, and the general-purpose register are transferred without passing through an external bus. A processor having a bank memory provided with a set.
【請求項3】 プログラムの実行に係る特定の情報を保
持する専用レジスタと、 プログラムの実行に係る不特定の情報を保持する汎用レ
ジスタと、 現在使用中のバンクを示す情報を保持する第1のレジス
タと、 戻りバンクを示す情報が外部バスを介することなく転送
される第1のバンクと、専用レジスタ及び汎用レジスタ
に保持されたそれぞれの情報が外部バスを介することな
く転送される第2のバンクとをそれぞれ複数セット備え
たバンクメモリと、 前記第1のレジスタに保持された情報に基づいて前記第
1のバンクを示す情報を算出する算出手段とを有するこ
とを特徴とするプロセッサ。
3. A dedicated register for holding specific information related to program execution, a general-purpose register for holding unspecified information related to program execution, and a first register for holding information indicating a bank currently in use. A register, a first bank in which information indicating a return bank is transferred without passing through an external bus, and a second bank in which information held in a dedicated register and a general-purpose register is transferred without passing through an external bus And a calculating means for calculating information indicating the first bank based on the information held in the first register.
【請求項4】 プログラムの実行に係る特定の情報を保
持する専用レジスタと、 プログラムの実行に係る不特定の情報を保持する汎用レ
ジスタと、 現在使用中のバンクを示す情報を保持する第1のレジス
タと、 現在実行中の処理が未終了で他の処理が開始される場合
に、前記第1のレジスタに保持されている現在使用中の
バンクを示す情報が転送され、この情報を戻りバンクを
示す情報として保持し、前記他の処理が終了した時に、
保持している情報が前記第1のレジスタに転送される第
2のレジスタと、 現在実行中の処理が未終了で他の処理が開始される場合
に、前記第2のレジスタと専用レジスタ及び汎用レジス
タに保持されている情報が外部バスを介することなく転
送されて保持され、前記他の処理が終了した時に、保持
している情報が前記第2のレジスタと専用レジスタ及び
汎用レジスタに外部バスを介することなく転送されるバ
ンクを複数セット備えたバンクメモリとを有することを
特徴とするプロセッサ。
4. A dedicated register for holding specific information related to program execution, a general-purpose register for holding unspecified information related to program execution, and a first register for holding information indicating a bank currently in use. The register and information indicating the bank currently in use held in the first register is transferred when the process currently being executed is not finished and another process is started, and this information is returned to the bank. It is retained as the information indicating, and when the other processing is finished,
The second register to which the held information is transferred to the first register, and the second register, the dedicated register, and the general-purpose register when the currently executed process is not finished and another process is started. The information held in the register is transferred and held without passing through the external bus, and when the other processing is completed, the held information is transferred to the second register, the dedicated register and the general-purpose register by the external bus. A bank memory having a plurality of sets of banks that are transferred without passing through the processor.
【請求項5】 プログラムの実行に係る特定の情報を保
持する専用レジスタと、 プログラムの実行に係る不特定の情報を保持する汎用レ
ジスタと、 現在使用中のバンクを示す情報を保持する第1のレジス
タと、 現在実行中の処理が未終了で他の処理が開始される場合
に、前記第1のレジスタに保持されている現在使用中の
バンクを示す情報が転送され、この情報を戻りバンクを
示す情報として保持し、前記他の処理が終了した時に、
保持している情報が前記第1のレジスタに転送される第
1のバンクと、現在実行中の処理が未終了で他の処理が
開始される場合に、前記専用レジスタ及び汎用レジスタ
に保持されている情報が外部バスを介することなく転送
されて保持され、前記他の処理が終了した時に、保持し
ている情報が前記専用レジスタ及び汎用レジスタに外部
バスを介することなく転送される第2のバンクとをそれ
ぞれ複数セット備えたバンクメモリと、 前記第1のレジスタに保持された情報に基づいて前記第
1のバンクを示す情報を算出する算出手段とを有するこ
とを特徴とするプロセッサ。
5. A dedicated register for holding specific information related to program execution, a general-purpose register for holding unspecified information related to program execution, and a first register for holding information indicating a bank currently in use. The register and information indicating the bank currently in use held in the first register is transferred when the process currently being executed is not finished and another process is started, and this information is returned to the bank. It is retained as the information indicating, and when the other processing is finished,
The first bank to which the held information is transferred to the first register, and the first bank to be held in the dedicated register and the general-purpose register when the currently executed process is not finished and another process is started. A second bank in which stored information is transferred and held without passing through an external bus, and when the other processing is completed, the held information is transferred to the dedicated register and general-purpose register without passing through an external bus. And a calculating means for calculating information indicating the first bank based on the information held in the first register.
【請求項6】 戻りバンクを示す情報が特定の値である
場合には、前記戻りバンクを示す情報及び前記専用レジ
スタの情報がスタックメモリに転送されることを特徴と
する請求項1記載のプロセッサ。
6. The processor according to claim 1, wherein when the information indicating the return bank has a specific value, the information indicating the return bank and the information of the dedicated register are transferred to a stack memory. .
【請求項7】 前記第2のレジスタに保持された情報が
特定の値である場合には、前記第2のレジスタに保持さ
れた情報及び前記専用レジスタの情報がスタックメモリ
に転送されることを特徴とする請求項2又は4記載のプ
ロセッサ。
7. When the information held in the second register has a specific value, the information held in the second register and the information in the dedicated register are transferred to a stack memory. The processor according to claim 2 or 4, characterized in that:
【請求項8】 前記第1のバンクに保持された情報が特
定の値である場合には、前記第1のバンクに保持された
情報及び前記専用レジスタの情報がスタックメモリに転
送されることを特徴とする請求項3又は5記載のプロセ
ッサ。
8. When the information held in the first bank has a specific value, the information held in the first bank and the information in the dedicated register are transferred to a stack memory. 6. A processor according to claim 3 or 5, characterized in that
【請求項9】 前記バンク指示手段が、現在使用中のバ
ンクを示す情報を保持する第1レジスタと、プログラム
の命令語が入っているメモリ領域のアドレスを示す第3
レジスタと、プロセッサの状態を示す第4レジスタと、
前記第3レジスタ及び前記第4レジスタの内容を指す第
1ポインタと、を有することを特徴とする請求項1及び
請求項3に記載のプロセッサ。
9. The bank instructing means stores a first register for holding information indicating a bank currently in use, and a third register for indicating an address of a memory area containing an instruction word of a program.
A register and a fourth register indicating the state of the processor,
4. The processor according to claim 1, further comprising a first pointer that points to the contents of the third register and the fourth register.
【請求項10】 前記バンク指示手段が、現在使用中の
バンクを示す情報を保持する第1レジスタと、プログラ
ムの命令語が入っているメモリ領域のアドレスを示す第
3レジスタと、プロセッサの状態を示す第4レジスタ
と、ベースバンクのアドレスを指す第2ポインタと、該
第3ポインタと第3レジスタ及び第4レジスタの内容が
退避するバンクとの間の距離情報を保持する第5レジス
タと、を有することを特徴とする請求項1及び請求項3
に記載のプロセッサ。
10. The bank instructing means stores a first register for holding information indicating a bank currently in use, a third register for indicating an address of a memory area in which an instruction word of a program is stored, and a state of the processor. A fourth register, a second pointer that points to an address of the base bank, and a fifth register that holds distance information between the third pointer and the bank in which the contents of the third register and the fourth register are saved. Claim 1 and Claim 3 characterized by having.
Processor described in.
【請求項11】 前記バンク指示手段が、プログラムの
命令語が入っているメモリ領域のアドレスを示す第3レ
ジスタと、プロセッサの状態を示す第4レジスタと、ベ
ースバンクのアドレスを指す第2ポインタと、第2ポイ
ンタと第1レジスタとの間の距離情報を保持する手段を
有することを特徴とする請求項1及び請求項3に記載の
プロセッサ。
11. The bank instructing means includes a third register indicating an address of a memory area containing an instruction word of a program, a fourth register indicating a state of a processor, and a second pointer indicating an address of a base bank. 4. The processor according to claim 1, further comprising means for holding distance information between the second pointer and the first register.
JP28195492A 1991-10-21 1992-10-20 Processor Expired - Lifetime JP3539984B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28195492A JP3539984B2 (en) 1991-10-21 1992-10-20 Processor

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP3-272750 1991-10-21
JP27275091 1991-10-21
JP28195492A JP3539984B2 (en) 1991-10-21 1992-10-20 Processor

Publications (2)

Publication Number Publication Date
JPH05210512A true JPH05210512A (en) 1993-08-20
JP3539984B2 JP3539984B2 (en) 2004-07-07

Family

ID=26550359

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28195492A Expired - Lifetime JP3539984B2 (en) 1991-10-21 1992-10-20 Processor

Country Status (1)

Country Link
JP (1) JP3539984B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR960706125A (en) * 1994-09-19 1996-11-08 요트.게.아. 롤페즈 A microcontroller system for performing operations of multiple microcontrollers
JP2019046138A (en) * 2017-09-01 2019-03-22 株式会社エルイーテック Processor including a plurality of register groups
KR20200060937A (en) 2018-11-23 2020-06-02 가천대학교 산학협력단 Medical superconducting magnet
JP2020086871A (en) * 2018-11-22 2020-06-04 Necプラットフォームズ株式会社 Information processor, program, operating system, execution method, and program correction method
JP2022175352A (en) * 2021-05-13 2022-11-25 株式会社平和 game machine

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR960706125A (en) * 1994-09-19 1996-11-08 요트.게.아. 롤페즈 A microcontroller system for performing operations of multiple microcontrollers
JP2019046138A (en) * 2017-09-01 2019-03-22 株式会社エルイーテック Processor including a plurality of register groups
JP2020086871A (en) * 2018-11-22 2020-06-04 Necプラットフォームズ株式会社 Information processor, program, operating system, execution method, and program correction method
KR20200060937A (en) 2018-11-23 2020-06-02 가천대학교 산학협력단 Medical superconducting magnet
JP2022175352A (en) * 2021-05-13 2022-11-25 株式会社平和 game machine

Also Published As

Publication number Publication date
JP3539984B2 (en) 2004-07-07

Similar Documents

Publication Publication Date Title
US5557766A (en) High-speed processor for handling multiple interrupts utilizing an exclusive-use bus and current and previous bank pointers to specify a return bank
US5701493A (en) Exception handling method and apparatus in data processing systems
US5386563A (en) Register substitution during exception processing
EP0511674B1 (en) Single chip microcomputer
US5812868A (en) Method and apparatus for selecting a register file in a data processing system
US4715013A (en) Coprocessor instruction format
EP0441054B1 (en) Method and apparatus for handling nested interrupts
JPH02267634A (en) Interrupt system
WO2010004243A2 (en) Interrupt processing
US4731736A (en) Method and apparatus for coordinating execution of an instruction by a selected coprocessor
JP2005100405A (en) System and method for loading software on multiple processors
US7290124B2 (en) Data processor employing register banks with overflow protection to enhance interrupt processing and task switching
JP2822782B2 (en) Single chip microcomputer
JPH05210512A (en) Processor
JP5131269B2 (en) Multi-processing system
Lindgren et al. ENEST-Efficient Interrupt Nesting for RISC-V based CPUs
JP4114946B2 (en) Data processing device
JP3659048B2 (en) Operating system and computer
JP2568017B2 (en) Microprocessor and data processing system using the same
US4758978A (en) Method and apparatus for selectively evaluating an effective address for a coprocessor
JPH0668725B2 (en) Device for responding to interrupt condition in data processing system and method for responding to asynchronous interrupt condition
JPS6049352B2 (en) data processing equipment
JP4756599B2 (en) Data processing device
JPS603229B2 (en) Information processing method
JPH0264740A (en) Microprocessor

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20031215

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040316

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040324

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080402

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090402

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100402

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100402

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110402

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130402

Year of fee payment: 9

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130402

Year of fee payment: 9