JPH06131250A - Data processor - Google Patents

Data processor

Info

Publication number
JPH06131250A
JPH06131250A JP28142192A JP28142192A JPH06131250A JP H06131250 A JPH06131250 A JP H06131250A JP 28142192 A JP28142192 A JP 28142192A JP 28142192 A JP28142192 A JP 28142192A JP H06131250 A JPH06131250 A JP H06131250A
Authority
JP
Japan
Prior art keywords
address
stack
bus
bank
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP28142192A
Other languages
Japanese (ja)
Inventor
Akira Nishimura
明 西村
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 JP28142192A priority Critical patent/JPH06131250A/en
Publication of JPH06131250A publication Critical patent/JPH06131250A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide the data processor which easily performs high-speed stack operation and is low in cost and improved in system performance. CONSTITUTION:A central processor 3 is equipped with an address decision means 15 which decides whether a stack pointer SP and the address indicated by the stack painter SP are in an address range for a 1st storage means 5 in the address space of a data processor and a bank control means 13 which performs control so that the reading and writing of a stack area accompanying R stack operation instruction are performed through a dedicated bus BBUS when the address decision means 15 decides that the address indicated by the stack painter SP is in the address range for the 1st storage means 5.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、レジスタバンク機能を
持つデータ処理装置のスタック操作技術に関し、特に、
内蔵するバンク用RAMに対してスタック操作を行なう
場合は、データ転送速度が高速なバンク転送バスを使用
して内蔵RAMのデータをアクセスするように制御する
ことにより、高速なスタック操作を容易に行なうデータ
処理装置データ処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a stack operation technique for a data processing device having a register bank function, and more particularly,
When performing a stack operation on the built-in bank RAM, the bank transfer bus having a high data transfer speed is used to access the data in the built-in RAM, thereby facilitating the high-speed stack operation. Data processing device The present invention relates to a data processing device.

【0002】[0002]

【従来の技術】マイクロコンピュータ等のデータ処理装
置のプログラムでは、スタックというデータ構造を用い
て、データの受け渡しや退避の処理がよく行なわれてい
る。特に、サブルーチンコールや割り込みの処理ではス
タック操作は必須であり、このスタック操作を効率的に
行なうことがシステム設計を行なう際に重要である。こ
のため、多くのプロセッサでは、スタック操作を行なう
ための専用の命令(PUSH命令/POP命令)や、ス
タック処理を行なうことを仮定した命令(CALL命令
/RET命令/RETI命令等)、並びに割り込み処理
機構を備えている。
2. Description of the Related Art In a program of a data processing device such as a microcomputer, a data structure called a stack is often used to transfer and save data. In particular, stack operation is indispensable for processing subroutine calls and interrupts, and efficient stack operation is important for system design. Therefore, in many processors, a dedicated instruction (PUSH instruction / POP instruction) for performing a stack operation, an instruction (CALL instruction / RET instruction / RETI instruction, etc.) that is supposed to perform stack processing, and interrupt processing It has a mechanism.

【0003】スタック領域は、メモリ空間上にとられ、
プロセッサはスタックポインタと呼ばれるレジスタを内
部に備えて、スタックポインタにより指示されるメモリ
アドレスをスタック領域の先頭アドレスとしてアクセス
する。
The stack area is taken in the memory space,
The processor internally includes a register called a stack pointer, and accesses a memory address designated by the stack pointer as the top address of the stack area.

【0004】プッシュ(PUSH)命令は、スタック領
域に指定したデータを格納する命令である。このプッシ
ュ命令により、先ず、書き込むデータのサイズ分だけス
タックポインタが減算(デクリメント)され、減算され
たスタックポインタによって指示されるアドレスにデー
タの書き込みが行なわれる。
The push (PUSH) instruction is an instruction for storing specified data in the stack area. By this push instruction, first, the stack pointer is decremented by the size of the data to be written, and the data is written to the address designated by the subtracted stack pointer.

【0005】ポップ(POP)命令は、スタック領域か
らデータを読み出す命令である。このポップ命令によ
り、スタックポインタの示すアドレスからデータが読み
出され、その後、読み出したデータのサイズ分だけスタ
ックポインタが加算(インクリメント)される。
The POP instruction is an instruction for reading data from the stack area. By this pop instruction, data is read from the address indicated by the stack pointer, and then the stack pointer is incremented by the size of the read data.

【0006】サブルーチンコールを行なう場合には、戻
り先のアドレスをスタック領域にプッシュしておいてか
らサブルーチンに分岐し、サブルーチンでの処理が終了
した時に、戻り先のアドレスをスタック領域からポップ
してくることにより、メインルーチンでのプログラムア
ドレスを得て、プログラムの処理を継続することがよく
行なわれる。またスタックを利用することにより、多重
にサブルーチンへの分岐を行なう場合にも対応できる。
When making a subroutine call, the return destination address is pushed to the stack area and then branched to the subroutine. When the processing in the subroutine is completed, the return destination address is popped from the stack area. Therefore, it is often performed to obtain the program address in the main routine and continue the processing of the program. Further, by using the stack, it is possible to cope with the case where the branch to the subroutine is multiply performed.

【0007】コール(CALL)命令とリターン(RE
T)命令は、サブルーチン分岐をサポートするためにプ
ロセッサに用意されている命令である。コール命令で
は、自動的に戻り先アドレスをスタックにプッシュした
後、プログラムカウンタにサブルーチンのアドレス(コ
ール命令のデスティネーションオペランドの実効アドレ
ス)をロードして、そのアドレスから命令の実行を行な
う。また、サブルーチンの終点ではリターン命令を実行
する。このリターン命令は、スタックポインタが示すア
ドレスのデータ(即ち、戻り先のアドレス)をポップし
てきてプログラムカウンタにロードし、そのアドレスの
命令から実行される。つまり、リターン命令の実行によ
り、スタックとスタックポインタはサブルーチン実行前
の状態に戻り、コール命令の次の命令からプログラムの
実行を継続する。
Call (CALL) instruction and return (RE)
The T) instruction is an instruction prepared in the processor to support a subroutine branch. The call instruction automatically pushes the return address onto the stack, loads the subroutine address (effective address of the destination operand of the call instruction) into the program counter, and executes the instruction from that address. At the end of the subroutine, a return instruction is executed. This return instruction is executed by popping the data at the address indicated by the stack pointer (that is, the return destination address), loading it into the program counter, and executing the instruction at that address. That is, the execution of the return instruction causes the stack and the stack pointer to return to the state before the execution of the subroutine, and the execution of the program is continued from the instruction following the call instruction.

【0008】また、メインルーチンからサブルーチンに
パラメータを渡す際にもスタックを利用することができ
る。コール命令を行なう前に、メインプログラムでプッ
シュ命令により必要な数のパラメータをスタックに格納
する。その後、コール命令によりサブルーチンに処理を
移す。サブルーチンでパラメータが必要になると、スタ
ックポインタからの相対アドレスでメモリをアクセス
し、スタックのトップにある戻り先アドレスを飛び越し
て、パラメータをアクセスして処理を行なう。この時必
要ならば、結果をパラメータのあった位置に書き戻して
おいて、結果をメインプログラムに渡すこともできる。
サブルーチンが終了すると、リターン命令を実行してメ
インプログラムに処理を戻す。メインプログラムでは、
スタックのポップを行ないサブルーチンからのデータを
受け取る。戻りデータの無い場合は、単にスタックポイ
ンタをインクリメントしてサブルーリンコール以前の元
のスタックポインタの値に戻しておけばよい。
The stack can also be used when passing parameters from the main routine to the subroutine. Before executing the call instruction, push the main program to store the required number of parameters in the stack. After that, the processing is shifted to the subroutine by the call instruction. When a parameter is required in the subroutine, the memory is accessed with a relative address from the stack pointer, the return address at the top of the stack is skipped, and the parameter is accessed for processing. At this time, if necessary, the result can be written back to the position where the parameter was and the result can be passed to the main program.
When the subroutine ends, a return instruction is executed to return the processing to the main program. In the main program,
Pop the stack and receive data from the subroutine. If there is no return data, simply increment the stack pointer to restore the original stack pointer value before the subroutine call.

【0009】次に、割り込みの処理におけるスタック操
作について説明する。割り込みが発生した時も、現在実
行中のプログラムから割り込み処理ルーチンへ処理を移
し、割り込みの処理が終了すると、元のプログラムの処
理を再開するという点では上述のサブルーチンコールと
似ている。しかしながら、実行中のプログラムでは割り
込みの発生を予期できないので、割り込み処理ルーチン
が終了して元のプログラムに戻る際には、元のプログラ
ム番地からの処理を再開するだけではなく、汎用レジス
タや制御レジスタの内容等を全て割り込み発生前の状態
に戻しておく必要がある。従って、割り込みの場合に
は、戻り番地をスタックに積むだけではなく、割り込み
処理ルーチンで使用するレジスタの一部または全部をス
タックに退避しておくことが行なわれる。プロセッサの
種類によって割り込み発生時における情報のセーブ方法
に差があり、以下のように分類される。
Next, a stack operation in interrupt processing will be described. It is similar to the above-mentioned subroutine call in that even when an interrupt occurs, the process is transferred from the program currently being executed to the interrupt processing routine, and when the interrupt process is completed, the process of the original program is restarted. However, since it is not possible to anticipate the occurrence of an interrupt in the program being executed, when the interrupt processing routine ends and returns to the original program, not only the processing from the original program address is restarted, but also general-purpose registers and control registers. It is necessary to return all the contents of to the state before the interrupt occurred. Therefore, in the case of an interrupt, not only is the return address stacked on the stack, but some or all of the registers used in the interrupt processing routine are saved on the stack. There is a difference in the method of saving information when an interrupt occurs depending on the type of processor, and it is classified as follows.

【0010】(1)戻り番地(プログラムカウンタの内
容)のみをスタックに自動的にセーブする。
(1) Only the return address (contents of the program counter) is automatically saved in the stack.

【0011】(2)プログラムカウンタ及びプロセッサ
ステータスワード(フラグ等のプロセッサの内部状態を
保持するレジスタで、以下PSWという)の内容をスタ
ックに自動的にセーブする。
(2) The contents of a program counter and a processor status word (a register that holds the internal state of the processor such as a flag; hereinafter referred to as PSW) are automatically saved in the stack.

【0012】(3)プログラムカウンタ、PSW、及び
汎用レジスタ等全てのレジスタをスタックにセーブす
る。
(3) Save all registers such as the program counter, PSW, and general-purpose registers in the stack.

【0013】(4)レジスタバンクと呼ばれる機能を準
備し、レジスタバンクを切り替えることにより全レジス
タのセーブを行なう。
(4) A function called a register bank is prepared and all registers are saved by switching the register bank.

【0014】(1)の方法では、割り込み処理ルーチン
のプログラムでPSW及び必要な汎用レジスタの退避
を、プッシュ(PUSH)命令を用いてスタックに対し
て行なう。また、割り込みからリターンする前に(割り
込みからのリターン(RETI)命令を実行する前
に)、スタックに退避したデータをポップして割り込み
発生前の状態に戻しておく。割り込みからのリターン命
令では、プログラムカウンタのみが自動的に復帰され、
元のプログラムの処理が継続される。この方法は、サブ
ルーチンの場合のコール(CALL)命令/リターン
(RET)命令と全く同じで、プロセッサがサポートす
るのは戻り先アドレスのスタックの退避と回復だけであ
り、PSWを含め必要なレジスタの退避は全て割り込み
処理ルーチンのプログラムで行なわれる。従ってこの方
法では、ハードウェアの負荷が軽いが、レジスタのセー
ブは全て命令で行なわなければならないため、退避する
レジスタが多い場合は低速となる。
In the method (1), the PSW and necessary general-purpose registers are saved in the stack using the push (PUSH) instruction in the program of the interrupt processing routine. Also, before returning from an interrupt (before executing a return from interrupt (RETI) instruction), the data saved in the stack is popped to return to the state before the interrupt occurred. With a return instruction from an interrupt, only the program counter is automatically restored,
The processing of the original program continues. This method is exactly the same as the call (CALL) instruction / return (RET) instruction in the case of a subroutine, and the processor supports only saving and restoring the stack of the return address, and the necessary registers including PSW All saving is performed by the program of the interrupt processing routine. Therefore, with this method, the load on the hardware is light, but since all the registers must be saved by instructions, it becomes slow when there are many registers to save.

【0015】(2)の方法では、割り込み処理ルーチン
のプログラムで必要な汎用レジスタの退避を、プッシュ
(PUSH)命令を用いてスタックに対して行なう。ま
た、割り込みからリターンする前に、スタックに退避し
た汎用レジスタのデータをポップして割り込み発生前の
状態に戻しておく。割り込みからのリターン(RET
I)命令で、自動的にスタックからPSW及びプログラ
ムカウンタの値がポップされ、元の状態に復帰される。
つまりこの方法では、(1)に加えて、PSWを自動的
にスタックにセーブするようになっている。PSWは殆
どの割り込み処理ルーチンでセーブする必要があり、こ
れを自動的に行なうことにより、(1)の方法に比べて
割り込みの処理時間が高速化される。しかしながら、汎
用レジスタのセーブは命令で行なわなければならないた
め、多くの汎用レジスタを退避しなければならない場合
には低速となる。
In the method (2), the general-purpose registers necessary for the program of the interrupt processing routine are saved to the stack by using the push (PUSH) instruction. Before returning from the interrupt, the data of the general-purpose register saved in the stack is popped to return to the state before the interrupt occurred. Return from interrupt (RET
The I) instruction automatically pops the PSW and program counter values from the stack and restores the original state.
That is, in this method, in addition to (1), the PSW is automatically saved in the stack. It is necessary to save the PSW in most interrupt processing routines, and by automatically performing this, the interrupt processing time is shortened compared to the method (1). However, saving of general-purpose registers must be performed by an instruction, and thus it becomes slow when many general-purpose registers must be saved.

【0016】(3)の方法では、割り込み発生時に、プ
ロセッサにより自動的に全てのレジスタがスタックにセ
ーブされるので、割り込み処理ルーチンのプログラムで
は、本来の割り込み処理の仕事を即座に開始できる。割
り込みからのリターン(RETI)命令では、自動的に
全てのレジスタの内容がスタックからポップされ、プロ
セッサは元の状態に復帰する。この方法では、プロセッ
サにより自動的に全てのレジスタをスタックに退避する
ので、割り込み処理ルーチンでは退避を行なう必要がな
い。従って、多くのレジスタをセーブする必要のある割
り込み処理の場合、(1)や(2)の方法に比べて高速
である。しかし、少数のレジスタの退避しか必要とされ
ない割り込み処理では、セーブする必要のないレジスタ
まで余分に退避してしまうので、逆に低速になってしま
う。
In the method (3), when the interrupt occurs, the processor automatically saves all the registers in the stack, so that the interrupt processing routine program can immediately start the original interrupt processing work. The return from interrupt (RETI) instruction automatically pops the contents of all registers from the stack and returns the processor to its original state. In this method, all the registers are automatically saved in the stack by the processor, so it is not necessary to save them in the interrupt processing routine. Therefore, in the case of interrupt processing that needs to save many registers, it is faster than the methods (1) and (2). However, in the interrupt processing in which only a small number of registers need to be saved, the registers that do not need to be saved are additionally saved, resulting in slower speed.

【0017】(4)の方法では、割り込み発生時に、プ
ロセッサがレジスタバンクを切り替えて自動的に全ての
レジスタの内容を退避する。この場合、退避先はスタッ
クではなく、レジスタバンクとして使用される内蔵RA
Mの所定の領域となる。レジスタの退避はプロセッサに
より全て行なわれているので、割り込み処理ルーチンの
プログラムでは、本来の割り込み処理の仕事を即座に開
始できる。割り込みからのリターン(RETI)命令で
は、自動的に全てのレジスタの内容がスタックからポッ
プされ、プロセッサは元の状態に復帰する。(4)の方
法は、スタックを使用せずにレジスタバンクという機能
を設けることにより、全レジスタを高速に退避すること
を可能としたもので、多数のレジスタを退避する場合
に、比較的高速である。
In the method (4), when an interrupt occurs, the processor switches the register banks and automatically saves the contents of all the registers. In this case, the save destination is not the stack but the internal RA used as a register bank.
It becomes a predetermined area of M. Since the registers are all saved by the processor, the original interrupt processing work can be immediately started in the interrupt processing routine program. The return from interrupt (RETI) instruction automatically pops the contents of all registers from the stack and returns the processor to its original state. The method (4) makes it possible to save all the registers at a high speed by providing a function called a register bank without using a stack. is there.

【0018】本発明は、割り込み処理で退避するレジス
タが少ない時に有利な(2)の方法と、退避するレジス
タが多い時に有利な(4)の方法を合わせ持つバンク機
能付きデータ処理装置のスタック操作を、更に高速にす
るための方法に関する。
According to the present invention, the stack operation of the data processing device with the bank function has both the method (2) which is advantageous when the number of registers saved in the interrupt processing is small and the method (4) which is advantageous when the number of registers saved is large. Is further speeded up.

【0019】以下に、本発明の適用対象となる従来技術
のマイクロコンピュータの動作について説明する。図5
は、従来のマイクロコンピュータの構成図である。
The operation of the prior art microcomputer to which the present invention is applied will be described below. Figure 5
FIG. 6 is a configuration diagram of a conventional microcomputer.

【0020】この従来のマイクロコンピュータ101
は、CPUコア103、内蔵RAM105、及びバスイ
ンタフェース108から構成され、ワンチップとして形
成されている。CPUコア103と内蔵RAM105は
データバスID(15:0)、アドレスバスIA(2
3:0)、及び制御信号バスIC(5:0)から成る内
部システムバスISBUSを介して接続されている。ま
たCPUコア103と内蔵RAM105は、バンク機能
を実現するために、バンクデータバスBNKD(63:
0)、バンクアドレスバスBNKA(10:0)、及び
バンク制御信号バスBNKC(3:0)から成るバンク
転送バスBBUSを介して接続されている。またマイク
ロコンピュータ101には、データバスOD(15:
0)、アドレスバスOA(23:0)、及び制御信号バ
スOC(5:0)から成る外部システムバスOSBUS
を介して、外部メモリ109が接続されている。
This conventional microcomputer 101
Is composed of a CPU core 103, a built-in RAM 105, and a bus interface 108, and is formed as one chip. The CPU core 103 and the built-in RAM 105 have a data bus ID (15: 0), an address bus IA (2
3: 0) and an internal system bus ISBUS composed of a control signal bus IC (5: 0). Further, the CPU core 103 and the built-in RAM 105 have a bank data bus BNKD (63:
0), bank address bus BNKA (10: 0), and bank control signal bus BNKC (3: 0). Further, the microcomputer 101 has a data bus OD (15:
0), an address bus OA (23: 0), and a control signal bus OC (5: 0), an external system bus OSBUS.
The external memory 109 is connected via.

【0021】CPUコア103の詳細構成図を図6に示
す。同図に示すように、CPUコア103は、スタック
ポインタSP、プログラムカウンタPC、プロセッサス
テータスワードPSW、汎用レジスタR0〜R15、バ
ンクポインタCBP及びPBP等のレジスタと、加算
器、シフタ等の演算回路ALUと、機械命令をデコード
してCPUコア103の内部回路の動作を制御するシー
ケンス制御回路21と、内部システムバスISBUSの
インタフェース制御を行なうバス制御回路123と、ア
ドレスバッファABと、データバッファDBと、バンク
転送バスBBUSのインタフェース制御を行なうバンク
制御回路125とから構成されている。また、シーケン
ス制御回路21内には、CPUコア103に割り込み信
号INTが入力されて割り込み処理時にレジスタの退避
をメモリスタックに対して行なうか、またはバンク(内
蔵RAM105)に対して行なうかを指定するスタック
/バンクフラグSBを具備している。
FIG. 6 is a detailed block diagram of the CPU core 103. As shown in the figure, the CPU core 103 includes registers such as a stack pointer SP, a program counter PC, a processor status word PSW, general-purpose registers R0 to R15, bank pointers CBP and PBP, and an arithmetic circuit ALU such as an adder and a shifter. A sequence control circuit 21 that decodes machine instructions to control the operation of the internal circuits of the CPU core 103, a bus control circuit 123 that controls the interface of the internal system bus ISBUS, an address buffer AB, and a data buffer DB. A bank control circuit 125 for controlling the interface of the bank transfer bus BBUS. Further, in the sequence control circuit 21, an interrupt signal INT is input to the CPU core 103 to specify whether to save a register for a memory stack or a bank (internal RAM 105) during interrupt processing. The stack / bank flag SB is provided.

【0022】PUSH/POP/CALL/RET命令
等の命令では、CPUコア103は、内部システムバス
ISBUS及び外部システムバスOSBUSを介して、
スタックポインタSPにより指示されるメモリ空間内の
スタック領域にリード/ライトしてスタック操作を行な
う。内蔵RAM105及び外部メモリ109は、メモリ
空間のアドレス上の適当な位置に配置されており、CP
Uコア103の出力するアドレスが内蔵RAM105の
配置されている領域に含まれる時には内部システムバス
ISBUSを介して内蔵RAM105がアクセスされ
る。また、CPUコア103の出力するアドレスが外部
メモリ109の配置されている領域に含まれる時には内
部システムバスISBUS−バスインタフェース108
−外部システムバスOSBUSを介して外部メモリ10
9がアクセスされる。従って、CPUコア103から外
部メモリ109のデータを読み書きするのには、2クロ
ックのバスサイクルを要する。
For instructions such as PUSH / POP / CALL / RET instructions, the CPU core 103 uses the internal system bus ISBUS and the external system bus OSBUS to
A stack operation is performed by reading / writing the stack area in the memory space designated by the stack pointer SP. The internal RAM 105 and the external memory 109 are arranged at appropriate positions on the address of the memory space, and CP
When the address output from the U core 103 is included in the area where the internal RAM 105 is arranged, the internal RAM 105 is accessed via the internal system bus ISBUS. Further, when the address output from the CPU core 103 is included in the area where the external memory 109 is arranged, the internal system bus ISBUS-bus interface 108
-External memory 10 via external system bus OSBUS
9 is accessed. Therefore, it takes two clock bus cycles to read and write data in the external memory 109 from the CPU core 103.

【0023】割り込み処理時には、CPUコア103内
部のスタック/バンクフラグSBの値によって、CPU
コア103が行なう割り込み処理の内容が変わってく
る。
At the time of interrupt processing, depending on the value of the stack / bank flag SB inside the CPU core 103, the CPU
The content of interrupt processing performed by the core 103 changes.

【0024】スタック/バンクフラグSBが”1”の時
には、CPUコア103はスタックポインタSPの示す
スタック領域に、戻り先アドレスであるプログラムカウ
ンタPCとプロセッサステータスワードPSWをプッシ
ュし、割り込みハンドラルーチンのプログラムに分岐す
る。この時のスタック操作はシステムバスを介して行な
われる。割り込みハンドラルーチンで汎用レジスタR0
〜R15の退避が必要な場合は、割り込みハンドラルー
チンにおいて前述のプッシュ(PUSH)命令を用いて
スタックに汎用レジスタR0〜R15の内容をプッシュ
する。
When the stack / bank flag SB is "1", the CPU core 103 pushes the program counter PC which is the return address and the processor status word PSW to the stack area indicated by the stack pointer SP to program the interrupt handler routine. Branch to. The stack operation at this time is performed via the system bus. General-purpose register R0 in the interrupt handler routine
When it is necessary to save .about.R15, the contents of the general registers R0 to R15 are pushed onto the stack by using the push (PUSH) instruction described above in the interrupt handler routine.

【0025】また、割り込みハンドラルーチンの最後に
割り込みリターン(RETI)命令を実行する前に、ス
タックに退避した汎用レジスタR0〜R15をポップ
(POP)命令によりスタックから読み出し、CPUコ
ア103内部の汎用レジスタR0〜R15に再ロードし
ておく。そしてRETI命令を実行することにより、自
動的にプログラムカウンタPC及びプロセッサステータ
スワードPSWをスタックからロードし、割り込み発生
前のプログラムの継続を行なう。
Before executing the interrupt return (RETI) instruction at the end of the interrupt handler routine, the general registers R0 to R15 saved in the stack are read from the stack by the pop (POP) instruction, and the general registers in the CPU core 103 are read. Reload to R0 to R15. Then, by executing the RETI instruction, the program counter PC and the processor status word PSW are automatically loaded from the stack, and the program before the interrupt is generated is continued.

【0026】スタック/バンクフラグSBが”0”の時
には、CPUコア103はバンク転送バスBBUSを介
してCPUコア103内部の全てのレジスタ(SP、P
C、PSW、SB、CBP、PBP、R0〜R15)の
内容を内蔵RAM105に退避する。バンク転送バスB
BUSは64ビット幅で、且つCPUコア103と内蔵
RAM105の専用のバスであるので、高速動作が可能
で1バスクロックで4ワードのデータ転送が可能であ
る。従って、CPUコア103内部の全レジスタの退避
に要する時間は5クロックと非常に高速である。
When the stack / bank flag SB is "0", the CPU core 103 sends all the registers (SP, P) inside the CPU core 103 via the bank transfer bus BBUS.
The contents of C, PSW, SB, CBP, PBP, R0 to R15) are saved in the internal RAM 105. Bank transfer bus B
Since the BUS has a 64-bit width and is a dedicated bus for the CPU core 103 and the built-in RAM 105, high-speed operation is possible and 4-word data transfer is possible with one bus clock. Therefore, the time required to save all the registers inside the CPU core 103 is as fast as 5 clocks.

【0027】プッシュ(PUSH)命令の動作は、シー
ケンス制御回路21の制御下で以下のように行なわれ
る。
The operation of the push (PUSH) instruction is performed as follows under the control of the sequence control circuit 21.

【0028】(1) スタックポインタSPの内容を内部バ
スに出力し、演算回路ALUにセットする。
(1) The contents of the stack pointer SP are output to the internal bus and set in the arithmetic circuit ALU.

【0029】(2) 演算回路ALUで減算を行ない、スタ
ックポインタSPをデクリメントする。
(2) The arithmetic circuit ALU performs a subtraction to decrement the stack pointer SP.

【0030】(3) 演算回路ALUの結果を内部バスに出
力し、スタックポインタSPをデクリメントした値をア
ドレスバッファAB及びスタックポインタSPにセット
する。 (4) プッシュするデータをデータバッファDBにセット
する。
(3) The result of the arithmetic circuit ALU is output to the internal bus, and the value obtained by decrementing the stack pointer SP is set in the address buffer AB and the stack pointer SP. (4) Set the data to be pushed in the data buffer DB.

【0031】(5) バス制御回路123に対して、アドレ
スバッファABのデータをアドレスとしてデータバッフ
ァDBにあるデータで書き込みバスサイクルを行なうよ
うに指示する。
(5) Instruct the bus control circuit 123 to perform a write bus cycle with the data in the data buffer DB using the data in the address buffer AB as an address.

【0032】(6) バス制御回路123は、指示に従って
アドレスバッファABの内容をアドレスバスIA(2
3:0)に出力し、データバッファDBのデータをデー
タバスID(15:0)に出力し、制御信号バスIC
(5:0)に必要な制御コードをのせて、データ書き込
みを実行する。
(6) The bus control circuit 123 transfers the contents of the address buffer AB to the address bus IA (2
3: 0), the data in the data buffer DB to the data bus ID (15: 0), and the control signal bus IC
A necessary control code is put on (5: 0) and data writing is executed.

【0033】ポップ(POP)命令の場合は、以下のよ
うになる。
In the case of a pop (POP) instruction, it becomes as follows.

【0034】(1) スタックポインタSPを内部バスに出
力し、アドレスバッファABにセットする。
(1) The stack pointer SP is output to the internal bus and set in the address buffer AB.

【0035】(2) バス制御回路123に対して、アドレ
スバッファABのデータをアドレスとした読み込みバス
サイクルを行ない、データをデータバッファDBに読ん
でくるように指示する。
(2) The bus control circuit 123 is instructed to perform a read bus cycle using the data in the address buffer AB as an address and read the data into the data buffer DB.

【0036】(3) バス制御回路123は、指示に従って
アドレスバッファABの内容をアドレスバスIA(2
3:0)に出力し、制御信号バスIC(5:0)に必要
な制御コードをのせて、データ読み込みのバスサイクル
を実行する。
(3) The bus control circuit 123 transfers the contents of the address buffer AB to the address bus IA (2
3: 0), and the necessary control code is placed on the control signal bus IC (5: 0) to execute a data read bus cycle.

【0037】(4) スタックポインタSPを内部バスに出
力し、演算回路ALUにセットする。 (5) 演算回路ALUで加算を行ない、スタックポインタ
SPの値をインクリメントする。
(4) The stack pointer SP is output to the internal bus and set in the arithmetic circuit ALU. (5) The arithmetic circuit ALU performs addition and increments the value of the stack pointer SP.

【0038】(6) 演算回路ALUの演算結果を内部バス
に出力し、スタックポインタSPに書き戻す。
(6) The calculation result of the calculation circuit ALU is output to the internal bus and written back to the stack pointer SP.

【0039】コール(CALL)命令では、プッシュ
(PUSH)命令と同様の操作でプログラムカウンタP
Cをスタックにプッシュした後、アドレスバッファAB
及びプログラムカウンタPCに分岐先のアドレスをセッ
トし、その後命令フェッチを行ない、命令をデコードし
てシーケンス制御回路21を動作させ、サブルーチンの
先頭の命令の処理を開始する。
In the call (CALL) instruction, the program counter P is operated by the same operation as the push (PUSH) instruction.
Address buffer AB after pushing C onto the stack
Then, the branch destination address is set in the program counter PC, the instruction is fetched, the instruction is decoded, the sequence control circuit 21 is operated, and the processing of the instruction at the head of the subroutine is started.

【0040】リターン(RET)命令では、ポップ(P
OP)命令と同様の操作で戻り番地をスタックからポッ
プした後、それをプログラムカウンタPC及びアドレス
バッファABにセットし、命令フェッチを行ない、戻り
先プログラムの命令の処理を開始する。
In the return (RET) instruction, the pop (P
After the return address is popped from the stack by the same operation as the (OP) instruction, it is set in the program counter PC and the address buffer AB, the instruction is fetched, and the processing of the instruction of the return destination program is started.

【0041】また割り込み発生時の情報退避の処理は、
シーケンス制御回路21内のスタック/バンクフラグS
Bの値に従って処理が異なり、以下のようになる。
The processing of saving information when an interrupt occurs is as follows:
Stack / bank flag S in the sequence control circuit 21
The processing differs depending on the value of B, and is as follows.

【0042】SB=1の時の割り込み処理は、以下のよ
うに行なわれる。
The interrupt processing when SB = 1 is performed as follows.

【0043】(1) スタックポインタSPの内容を演算回
路ALUを用いてデクリメントして、アドレスバッファ
AB及びスタックポインタSPに書き込む。
(1) The contents of the stack pointer SP are decremented by using the arithmetic circuit ALU and written in the address buffer AB and the stack pointer SP.

【0044】(2) プロセッサステータスワードPSWの
内容を内部バスに読み出し、データバッファDBにセッ
トする。
(2) The contents of the processor status word PSW are read out to the internal bus and set in the data buffer DB.

【0045】(3) バス制御回路123に対して、アドレ
スバッファABのデータをアドレスとしてデータバッフ
ァDBにあるデータで書き込みバスサイクルを行なうよ
うに指示する。
(3) The bus control circuit 123 is instructed to perform a write bus cycle with the data in the data buffer DB using the data in the address buffer AB as an address.

【0046】(4) バス制御回路123は、指示に従って
アドレスバッファABの内容をアドレスバスIA(2
3:0)に出力し、データバッファDBのデータをデー
タバスID(15:0)に出力し、制御信号バスIC
(5:0)に必要な制御コードをのせて、データ書き込
みを実行する。
(4) The bus control circuit 123 transfers the contents of the address buffer AB to the address bus IA (2
3: 0), the data in the data buffer DB to the data bus ID (15: 0), and the control signal bus IC
A necessary control code is put on (5: 0) and data writing is executed.

【0047】(5) 再びスタックポインタSPの内容を演
算回路ALUを用いてデクリメントし、アドレスバッフ
ァAB及びスタックポインタSPに書き込む。
(5) The contents of the stack pointer SP are again decremented by using the arithmetic circuit ALU and written in the address buffer AB and the stack pointer SP.

【0048】(6) プログラムカウンタPCの内容を内部
バスに読み出し、データバッファDBにセットする。
(6) The contents of the program counter PC are read out to the internal bus and set in the data buffer DB.

【0049】(7) バス制御回路123に対して、アドレ
スバッファABのデータをアドレスとしてデータバッフ
ァDBにあるデータで書き込みバスサイクルを行なうよ
うに指示する。
(7) The bus control circuit 123 is instructed to use the data in the address buffer AB as an address to perform a write bus cycle with the data in the data buffer DB.

【0050】(8) バス制御回路123は、指示に従って
アドレスバッファABの内容をアドレスバスIA(2
3:0)に出力し、データバッファDBのデータをデー
タバスID(15:0)に出力し、制御信号バスIC
(5:0)に必要な制御コードをのせて、データ書き込
みを実行する。
(8) The bus control circuit 123 transfers the contents of the address buffer AB to the address bus IA (2
3: 0), the data in the data buffer DB to the data bus ID (15: 0), and the control signal bus IC
A necessary control code is put on (5: 0) and data writing is executed.

【0051】(9) 割り込み処理プログラムの先頭アドレ
スをプログラムカウンタPC及びアドレスバッファAB
にセットして、命令フェッチを行ない、割り込み処理プ
ログラムルーチンの先頭の命令の処理を開始する。
(9) The start address of the interrupt processing program is set to the program counter PC and the address buffer AB.
, The instruction fetch is performed, and the processing of the first instruction of the interrupt processing program routine is started.

【0052】また、SB=1の時の割り込みリターン
(RETI)命令の処理は、以下のように行なわれる。
The processing of the interrupt return (RETI) instruction when SB = 1 is performed as follows.

【0053】(1) スタックポインタSPを内部バスに出
力し、アドレスバッファABにセットする。
(1) The stack pointer SP is output to the internal bus and set in the address buffer AB.

【0054】(2) バス制御回路123に対して、アドレ
スバッファABのデータをアドレスとした読み込みバス
サイクルを行ない、データ(この場合、割り込み前のプ
ログラムカウンタPCの内容)をデータバッファDBに
読んでくるように指示する。
(2) The bus control circuit 123 is subjected to a read bus cycle with the data in the address buffer AB as an address, and the data (in this case, the contents of the program counter PC before the interrupt) is read into the data buffer DB. Instruct them to come.

【0055】(3) バス制御回路123は、指示に従って
アドレスバッファABの内容をアドレスバスIA(2
3:0)に出力し、制御信号バスIC(5:0)に必要
な制御コードをのせて、データ読み込みのバスサイクル
を実行する。
(3) The bus control circuit 123 transfers the contents of the address buffer AB to the address bus IA (2
3: 0), and the necessary control code is placed on the control signal bus IC (5: 0) to execute a data read bus cycle.

【0056】(4) スタックポインタSPを内部バスに出
力し、演算回路ALUで加算を行ない、スタックポイン
タSPの値をインクリメントする。
(4) The stack pointer SP is output to the internal bus, the arithmetic circuit ALU performs addition, and the value of the stack pointer SP is incremented.

【0057】(5) バス制御回路123に対して、アドレ
スバッファABのデータをアドレスとした読み込みバス
サイクルを行ない、データ(この場合、割り込み前のプ
ロセッサステータスワードPSWの内容)をデータバッ
ファDBに読んでくるように指示する。
(5) The bus control circuit 123 is subjected to a read bus cycle using the data in the address buffer AB as an address, and the data (in this case, the contents of the processor status word PSW before the interrupt) is read into the data buffer DB. Instruct them to come out.

【0058】(6) バス制御回路123は、指示に従って
アドレスバッファABの内容をアドレスバスIA(2
3:0)に出力し、制御信号バスIC(5:0)に必要
な制御コードをのせて、データ読み込みのバスサイクル
を実行する。
(6) The bus control circuit 123 transfers the contents of the address buffer AB to the address bus IA (2
3: 0), and the necessary control code is placed on the control signal bus IC (5: 0) to execute a data read bus cycle.

【0059】(7) スタックポインタSPを内部バスに出
力し、演算回路ALUで加算を行ない、スタックポイン
タSPの値をインクリメントし、この値をアドレスバッ
ファAB及びスタックポインタSPに書き込む。
(7) The stack pointer SP is output to the internal bus, the arithmetic circuit ALU performs addition, the value of the stack pointer SP is incremented, and this value is written to the address buffer AB and the stack pointer SP.

【0060】(8) 読んできたプロセッサステータスワー
ドPSWのデータをプロセッサステータスワードPSW
に書き込んで元の値に復帰させる。また、読んできた割
り込み前のプログラムカウンタPCのデータをアドレス
バッファAB及びプログラムカウンタPCに書き込み、
そのアドレスで命令フェッチを行ない、割り込み前のプ
ログラムの処理を開始する。
(8) The data of the read processor status word PSW is set to the processor status word PSW.
Write to to restore the original value. Further, the read data of the program counter PC before the interruption is written in the address buffer AB and the program counter PC,
The instruction is fetched at that address and the processing of the program before the interrupt is started.

【0061】また、SB=0の時のCPUコア103内
部のレジスタの退避は、バンク制御回路123により内
蔵RAM105に対して直接行なわれ、その処理は以下
のようになる。尚、記号”!”は連結演算子である。
Further, the saving of the register inside the CPU core 103 when SB = 0 is directly performed by the bank control circuit 123 to the built-in RAM 105, and the processing is as follows. The symbol "!" Is a concatenation operator.

【0062】(1) 汎用レジスタR0〜R3の64ビット
分のデータをバンクデータバスBNKD(63:0)
に、アドレス(CBP)!000をバンクアドレスバス
BNKA(10:0)にそれぞれ出力し、内蔵RAM1
05に書き込む。
(1) The 64-bit data of the general-purpose registers R0 to R3 are transferred to the bank data bus BNKD (63: 0).
At the address (CBP)! 000 to the bank address bus BNKA (10: 0) respectively, and
Write to 05.

【0063】(2) 汎用レジスタR4〜R7の64ビット
分のデータをバンクデータバスBNKD(63:0)
に、アドレス(CBP+1)!000をバンクアドレス
バスBNKA(10:0)にそれぞれ出力し、内蔵RA
M105に書き込む。
(2) The 64-bit data of the general-purpose registers R4 to R7 are transferred to the bank data bus BNKD (63: 0).
At the address (CBP + 1)! 000 to the bank address bus BNKA (10: 0) respectively, and the built-in RA
Write to M105.

【0064】(3) 汎用レジスタR8〜R11の64ビッ
ト分のデータをバンクデータバスBNKD(63:0)
に、アドレス(CBP+2)!000をバンクアドレス
バスBNKA(10:0)にそれぞれ出力し、内蔵RA
M105に書き込む。
(3) The 64-bit data of the general-purpose registers R8 to R11 are transferred to the bank data bus BNKD (63: 0).
At the address (CBP + 2)! 000 to the bank address bus BNKA (10: 0) respectively, and the built-in RA
Write to M105.

【0065】(4) 汎用レジスタR12〜R15の64ビ
ット分のデータをバンクデータバスBNKD(63:
0)に、アドレス(CBP+3)!000をバンクアド
レスバスBNKA(10:0)にそれぞれ出力し、内蔵
RAM105に書き込む。
(4) The 64-bit data of the general-purpose registers R12 to R15 are transferred to the bank data bus BNKD (63:
0) to the address (CBP + 3)! 000 is output to the bank address bus BNKA (10: 0) and written in the internal RAM 105.

【0066】(5) プログラムカウンタPC、プロセッサ
ステータスワードPSW、及びバンクポインタPBPの
内容を64ビット分のデータとしてバンクデータバスB
NKD(63:0)に、アドレス(CBP+4)!00
0をバンクアドレスバスBNKA(10:0)にそれぞ
れ出力し、内蔵RAM105に書き込む。
(5) Bank data bus B with the contents of the program counter PC, processor status word PSW, and bank pointer PBP as 64-bit data.
Address (CBP + 4) to NKD (63: 0)! 00
0 is output to the bank address bus BNKA (10: 0) and written in the internal RAM 105.

【0067】(6) バンクポインタCBPの値を内部バス
を介してバンクポインタPBPに書き込む。
(6) The value of the bank pointer CBP is written in the bank pointer PBP via the internal bus.

【0068】(7) バンクポインタCBPに、割り込み処
理で使用するバンク番号をデータバッファDBから読み
出して書き込む。
(7) The bank number used in interrupt processing is read from the data buffer DB and written in the bank pointer CBP.

【0069】(8) プログラムカウンタPC及びアドレス
バッファABに、割り込み処理ハンドラルーチンの先頭
アドレスを読み出して設定し、先頭命令のフェッチを開
始し、割り込みハンドラの処理を行なう。
(8) The start address of the interrupt handler routine is read and set in the program counter PC and the address buffer AB, the fetch of the start instruction is started, and the interrupt handler process is performed.

【0070】更に、SB=1の時の割り込みリターン
(RETI)命令は、以下のように行なわれる。
Further, the interrupt return (RETI) instruction when SB = 1 is performed as follows.

【0071】(1) バンクポインタPBPの内容を内部バ
スを介してバンクポインタCBPにセットする。
(1) The contents of the bank pointer PBP are set in the bank pointer CBP via the internal bus.

【0072】(2) アドレス(CBP)!000をバンク
アドレスバスBNKA(10:0)に出力し、内蔵RA
M105からバンクデータバスBNKD(63:0)に
データを読み出し、汎用レジスタR0〜R3に書き込
む。
(2) Address (CBP)! 000 is output to the bank address bus BNKA (10: 0) and the built-in RA
The data is read from M105 to the bank data bus BNKD (63: 0) and written in the general-purpose registers R0 to R3.

【0073】(3) アドレス(CBP+1)!000をバ
ンクアドレスバスBNKA(10:0)に出力し、内蔵
RAM105からバンクデータバスBNKD(63:
0)にデータを読み出し、汎用レジスタR4〜R7に書
き込む。
(3) Address (CBP + 1)! 000 to the bank address bus BNKA (10: 0), and the internal RAM 105 outputs the bank data bus BNKD (63:
The data is read to 0) and written in the general-purpose registers R4 to R7.

【0074】(4) アドレス(CBP+2)!000をバ
ンクアドレスバスBNKA(10:0)に出力し、内蔵
RAM105からバンクデータバスBNKD(63:
0)にデータを読み出し、汎用レジスタR8〜R11に
書き込む。
(4) Address (CBP + 2)! 000 to the bank address bus BNKA (10: 0), and the internal RAM 105 outputs the bank data bus BNKD (63:
The data is read to 0) and written in the general-purpose registers R8 to R11.

【0075】(5) アドレス(CBP+3)!000をバ
ンクアドレスバスBNKA(10:0)に出力し、内蔵
RAM105からバンクデータバスBNKD(63:
0)にデータを読み出し、汎用レジスタR12〜R15
に書き込む。
(5) Address (CBP + 3)! 000 to the bank address bus BNKA (10: 0), and the internal RAM 105 outputs the bank data bus BNKD (63:
0) read the data to general purpose registers R12 to R15
Write in.

【0076】(6) アドレス(CBP+4)!000をバ
ンクアドレスバスBNKA(10:0)に出力し、内蔵
RAM105からバンクデータバスBNKD(63:
0)にデータを読み出し、プログラムカウンタPC、プ
ロセッサステータスワードPSW、及びバンクポインタ
PBPに書き込む。
(6) Address (CBP + 4)! 000 to the bank address bus BNKA (10: 0), and the internal RAM 105 outputs the bank data bus BNKD (63:
The data is read to 0) and written to the program counter PC, the processor status word PSW, and the bank pointer PBP.

【0077】(7) 復帰したプログラムカウンタPCの値
をアドレスバッファABにセットし、命令フェッチを開
始し、割り込み処理発生前のプログラムの実行を開始す
る。
(7) The value of the returned program counter PC is set in the address buffer AB, the instruction fetch is started, and the execution of the program before the interrupt processing is started.

【0078】[0078]

【発明が解決しようとする課題】以上のように、従来の
データ処理装置では、割り込みが発生してスタック/バ
ンクフラグが”0”であれば、バンク転送バスBBUS
を介して高速にデータ転送を行なうので高速な割り込み
処理が可能である。しかし、スタック/バンクフラグS
Bが”1”の時に、スタック操作命令により必要な汎用
レジスタの退避と復帰をスタック領域から行なう場合に
は、退避先が内蔵RAM105であってもシステムバス
を介してデータアクセスを行なうため、ワードデータの
アクセスに2クロックかかり低速であり、また、サブル
ーチンコール等で、内蔵RAM105にスタック操作を
行なおうとした場合も同様に、システムバスを介してデ
ータのアクセスを行なうため低速であるという欠点があ
った。
As described above, in the conventional data processing device, when the interrupt occurs and the stack / bank flag is "0", the bank transfer bus BBUS.
High-speed interrupt processing is possible because data is transferred at high speed via. However, the stack / bank flag S
When B is "1", when a general-purpose register is saved and restored by a stack operation instruction from the stack area, data is accessed via the system bus even if the save destination is the internal RAM 105. It takes 2 clocks to access the data at a low speed, and also when the stack operation is attempted to be performed in the built-in RAM 105 by a subroutine call or the like, the data access is performed via the system bus, which is a slow speed. there were.

【0079】本発明は、上記問題点を解決するもので、
その目的は、レジスタバンク機能付きのデータ処理装置
において、内蔵するバンク用RAMに対してスタック操
作を行なう場合は、データ転送速度が高速なバンク転送
バスを使用して内蔵RAMのデータをアクセスするよう
に制御することにより、高速なスタック操作を容易に行
ない得る、低コストでシステム性能の向上したデータ処
理装置を提供することである。
The present invention solves the above problems.
The purpose is to access data in the built-in RAM using a bank transfer bus having a high data transfer speed when performing stack operation on the built-in bank RAM in a data processing device having a register bank function. It is to provide a low-cost data processing device with improved system performance that can easily perform high-speed stack operation by controlling the data processing.

【0080】[0080]

【課題を解決するための手段】前記課題を解決するため
に、本発明の第1の特徴は、図1(1)に示す如く、プ
ログラムの処理を行なう中央処理装置3と、バンクとし
て使用される第1の記憶手段5と、前記プログラムを保
持する第2の記憶手段7とを具備し、前記中央処理装置
3、第1の記憶手段5、及び第2の記憶手段7は、シス
テムバスSBUSで接続され、前記中央処理装置3及び
第1の記憶手段5は、専用のバスBBUSで接続され、
前記中央処理装置3は、スタックポインタSPと、前記
スタックポインタSPの示すアドレスが、当該データ処
理装置におけるアドレス空間内の前記第1の記憶手段5
に対するアドレス範囲にあるか否かを判定するアドレス
判定手段15と、前記アドレス判定手段15により、前
記スタックポインタSPの示すアドレスが、前記第1の
記憶手段5に対するアドレス範囲にあると判定された場
合には、スタック操作命令に伴うスタック領域への読み
書きを、前記専用のバスBBUSを介して行なうよう制
御するバンク制御手段13とを具備することである。
In order to solve the above-mentioned problems, the first feature of the present invention is to use a central processing unit 3 for processing a program and a bank as shown in FIG. 1 (1). And a second storage unit 7 for holding the program. The central processing unit 3, the first storage unit 5, and the second storage unit 7 include a system bus SBUS. And the central processing unit 3 and the first storage means 5 are connected by a dedicated bus BBUS,
In the central processing unit 3, the stack pointer SP and the first storage unit 5 in which the address indicated by the stack pointer SP is in the address space of the data processing unit.
When the address indicated by the stack pointer SP is judged by the address judging means 15 for judging whether or not it is in the address range for the first storage means 5. The bank control means 13 for controlling reading and writing to and from the stack area according to the stack operation instruction via the dedicated bus BBUS.

【0081】また、本発明の第2の特徴は、図1(1)
及び(2)に示す如く、プログラムの処理を行なう中央
処理装置3’と、バンクとして使用される第1の記憶手
段5と、前記プログラムを保持する第2の記憶手段7と
を具備し、前記中央処理装置3’、第1の記憶手段5、
及び第2の記憶手段7は、システムバスSBUSで接続
され、前記中央処理装置3’及び第1の記憶手段5は、
専用のバスBBUSで接続され、前記中央処理装置3’
は、前記第1の記憶手段5に対して、前記専用のバスB
BUSを介してアクセスするためのアドレスを保持する
バンクスタックポインタBSPと、前記バンクスタック
ポインタBSPの示すアドレスに基づき、前記第1の記
憶手段5におけるスタック領域への読み書きを、前記専
用のバスBBUSを介して行なうよう制御するバンク制
御手段13’とを具備し、前記バンクスタックポインタ
BSPの指示する前記第1の記憶手段5のアドレスに対
して、当該中央処理装置3’内の複数のレジスタの保持
するデータを前記専用のバスBBUSを介して一度にデ
ータ転送して、スタック操作を行なう機械命令を備える
ことである。
The second feature of the present invention is that FIG.
And (2), it comprises a central processing unit 3 ′ for processing a program, a first storage means 5 used as a bank, and a second storage means 7 for holding the program, Central processing unit 3 ', first storage means 5,
And the second storage means 7 are connected by a system bus SBUS, and the central processing unit 3 ′ and the first storage means 5 are
Connected by a dedicated bus BBUS, the central processing unit 3 '
Is the dedicated bus B for the first storage means 5.
A bank stack pointer BSP holding an address for accessing via the BUS, and reading / writing from / to a stack area in the first storage means 5 based on the address indicated by the bank stack pointer BSP, by using the dedicated bus BBUS. A bank control unit 13 'for controlling the execution of the register via a bank stack pointer BSP, and holds a plurality of registers in the central processing unit 3'at the address of the first storage unit 5 designated by the bank stack pointer BSP. This is to provide a machine instruction for performing stack operation by transferring data to be transferred at one time through the dedicated bus BBUS.

【0082】更に、本発明の第3の特徴は、請求項1ま
たは2に記載のデータ処理装置において、前記中央処理
装置3または3’、第1の記憶手段5、及び第2の記憶
手段7は、ワンチップ上に構成されることである。
Furthermore, a third feature of the present invention is that in the data processing device according to claim 1 or 2, the central processing device 3 or 3 ′, the first storage means 5, and the second storage means 7 are provided. Is to be configured on one chip.

【0083】[0083]

【作用】本発明の第1及び第3の特徴のデータ処理装置
では、図1(1)に示す如く、中央処理装置3におい
て、アドレス判定手段15により、スタックポインタS
Pの示すアドレスが当該データ処理装置におけるアドレ
ス空間内の第1の記憶手段5に対するアドレス範囲にあ
るか否かを判定し、スタックポインタSPの示すアドレ
スが第1の記憶手段5に対するアドレス範囲にあると判
定された場合には、バンク制御手段13により、スタッ
ク操作命令に伴うスタック領域への読み書きを、専用の
バスBBUSを介して行なうよう制御する。
In the data processing device of the first and third features of the present invention, as shown in FIG. 1A, the address determination means 15 in the central processing unit 3 causes the stack pointer S to move.
It is determined whether the address indicated by P is within the address range for the first storage means 5 in the address space of the data processing device, and the address indicated by the stack pointer SP is within the address range for the first storage means 5. If it is determined that, the bank control unit 13 controls to read / write the stack area in accordance with the stack operation instruction via the dedicated bus BBUS.

【0084】これにより、スタックポインタSPが示し
ているアドレスを自動的に判定し、スタック領域が第1
の記憶手段5の領域にある場合には、中央処理装置3と
第1の記憶手段5間の専用のバスBBUSを用いて高速
に読み書きすることができ、結果として、高速なスタッ
ク操作を容易に行ない得る、低コストでシステム性能の
向上したデータ処理装置を実現できる。
As a result, the address indicated by the stack pointer SP is automatically determined and the stack area is set to the first area.
When it is in the area of the storage means 5, the read / write can be performed at high speed by using the dedicated bus BBUS between the central processing unit 3 and the first storage means 5, and as a result, high-speed stack operation is facilitated. It is possible to realize a low-cost data processing device with improved system performance.

【0085】また、本発明の第2及び第3の特徴のデー
タ処理装置では、図1(1)及び(2)に示す如く、中
央処理装置3’の一機械命令として、バンクスタックポ
インタBSPの指示する第1の記憶手段5のアドレスに
対して、当該中央処理装置3’内の複数のレジスタの保
持するデータを専用のバスBBUSを介して一度にデー
タ転送して、スタック操作を行なう機械命令を備え、該
機械命令発行時には、バンク制御手段13’によりバン
クスタックポインタBSPの示すアドレスに基づき、第
1の記憶手段5におけるスタック領域への読み書きを専
用のバスBBUSを介して行なうよう制御する。
In the data processor of the second and third features of the present invention, as shown in (1) and (2) of FIG. 1, the bank stack pointer BSP is set as one machine instruction of the central processing unit 3 '. A machine instruction for performing stack operation by transferring data held by a plurality of registers in the central processing unit 3 ′ at a time to a designated address of the first storage means 5 through a dedicated bus BBUS to perform stack operation. At the time of issuing the machine instruction, the bank control means 13 'controls the reading and writing to the stack area in the first storage means 5 through the dedicated bus BBUS based on the address indicated by the bank stack pointer BSP.

【0086】これにより、前記機械命令発行時には、第
1の記憶手段5上のスタック領域に対して、中央処理装
置3’内のレジスタ群の保持するデータの読み出し及び
書き込みを専用のバスBBUSで高速に行なうことがで
き、結果として、高速なスタック操作を容易に行ない得
る、低コストでシステム性能の向上したデータ処理装置
を実現できる。
As a result, at the time of issuing the machine instruction, the reading and writing of the data held by the register group in the central processing unit 3'to the stack area on the first storage means 5 is performed at high speed by the dedicated bus BBUS. As a result, it is possible to realize a low-cost data processing apparatus with improved system performance, which can easily perform high-speed stack operation.

【0087】[0087]

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

【0088】図1に本発明の第1の実施例に係るデータ
処理装置の構成図を示す。同図において、図5(従来
例)と重複する部分には同一の符号を附する。
FIG. 1 shows a block diagram of a data processing apparatus according to the first embodiment of the present invention. In the figure, the same parts as those in FIG. 5 (conventional example) are designated by the same reference numerals.

【0089】本実施例のデータ処理装置はワンチップ上
に構成されたマイクロプロセッサ(以下、MPUと略記
する)1と外部メモリ9からなり、MPU1と外部メモ
リ9は、データバスOD(15:0)、アドレスバスO
A(23:0)、及び制御信号バスOC(5:0)から
成る外部システムバスOSBUSを介して接続されてい
る。
The data processor of this embodiment comprises a microprocessor (hereinafter abbreviated as MPU) 1 and an external memory 9 formed on one chip. The MPU 1 and the external memory 9 are connected to the data bus OD (15: 0). ), Address bus O
They are connected via an external system bus OSBUS composed of A (23: 0) and a control signal bus OC (5: 0).

【0090】図1において、MPU1は、CPUコア
3、内蔵RAM5、及びバスインタフェース8から構成
され、ワンチップとして形成されている。CPUコア3
と内蔵RAM5はデータバスID(15:0)、アドレ
スバスIA(23:0)、及び制御信号バスIC(5:
0)から成る内部システムバスISBUSを介して接続
され、またCPUコア3と内蔵RAM5は、バンク機能
を実現するために、バンクデータバスBNKD(63:
0)、バンクアドレスバスBNKA(10:0)、及び
バンク制御信号バスBNKC(3:0)から成るバンク
転送バスBBUSを介して接続されている。
In FIG. 1, the MPU 1 is composed of a CPU core 3, a built-in RAM 5 and a bus interface 8 and is formed as one chip. CPU core 3
The built-in RAM 5 has a data bus ID (15: 0), an address bus IA (23: 0), and a control signal bus IC (5:
0) connected via the internal system bus ISBUS, and the CPU core 3 and the built-in RAM 5 realize the bank function by using the bank data bus BNKD (63:
0), bank address bus BNKA (10: 0), and bank control signal bus BNKC (3: 0).

【0091】第1実施例のCPUコア3の詳細構成図を
図2に示す。同図に示すように、CPUコア3は、スタ
ックポインタSP、プログラムカウンタPC、プロセッ
サステータスワードPSW、汎用レジスタR0〜R1
5、バンクポインタCBP及びPBP等のレジスタと、
加算器、シフタ等の演算回路ALUと、機械命令をデコ
ードしてCPUコア3の内部回路の動作を制御するシー
ケンス制御回路21と、内部システムバスISBUSの
インタフェース制御を行なうバス制御回路23と、アド
レスバッファABと、データバッファDBと、バンク転
送バスBBUSのインタフェース制御を行なうバンク制
御回路25と、スタックポインタSPのアドレスを判定
するアドレス判定回路27と、アドレス判定回路27の
結果を保持するヒットフラグHITと、メモリスタック
の操作命令であることを示すメモリスタックフラグMS
とから構成されている。
FIG. 2 shows a detailed configuration diagram of the CPU core 3 of the first embodiment. As shown in the figure, the CPU core 3 includes a stack pointer SP, a program counter PC, a processor status word PSW, and general-purpose registers R0 to R1.
5, registers such as bank pointers CBP and PBP,
An arithmetic circuit ALU such as an adder and a shifter, a sequence control circuit 21 that decodes machine instructions to control the operation of the internal circuit of the CPU core 3, a bus control circuit 23 that controls the interface of the internal system bus ISBUS, and an address. The buffer AB, the data buffer DB, the bank control circuit 25 that controls the interface of the bank transfer bus BBUS, the address determination circuit 27 that determines the address of the stack pointer SP, and the hit flag HIT that holds the result of the address determination circuit 27. And a memory stack flag MS indicating that it is a memory stack operation instruction
It consists of and.

【0092】また、シーケンス制御回路21内には、C
PUコア3に割り込み信号INTが入力されて割り込み
処理時にレジスタの退避をメモリスタックに対して行な
うか、またはバンク(内蔵RAM5)に対して行なうか
を指定するスタック/バンクフラグSBを具備してい
る。また、データバッファDBとバンク制御回路25が
接続されていること、スタックポインタSPの出力をバ
ンク制御回路25に接続したことが、従来例(図6)と
異なる点である。尚、ヒットフラグHIT及びメモリス
タックフラグMSは、バス制御回路23及びバンク制御
回路25に接続されている。
In the sequence control circuit 21, C
The PU core 3 is provided with a stack / bank flag SB that designates whether the interrupt signal INT is input and the registers are saved in the memory stack or in the bank (internal RAM 5) during interrupt processing. . Further, the data buffer DB and the bank control circuit 25 are connected, and the output of the stack pointer SP is connected to the bank control circuit 25, which is different from the conventional example (FIG. 6). The hit flag HIT and the memory stack flag MS are connected to the bus control circuit 23 and the bank control circuit 25.

【0093】メモリスタックフラグMSは、シーケンス
制御回路21により機械命令をデコードして、該機械命
令がスタック操作命令である時にセットされる。尚、ス
タック操作命令としては、PUSH/POP/CALL
/RET命令等の命令がある。
The memory stack flag MS is set when the machine instruction is decoded by the sequence control circuit 21 and the machine instruction is a stack operation instruction. The stack operation instructions are PUSH / POP / CALL.
There are instructions such as the / RET instruction.

【0094】 メモリスタックフラグMS=1:スタック操作命令 メモリスタックフラグMS=0:スタック操作命令でな
い またヒットフラグHITは、アドレス判定回路27の出
力がセットされ、スタックポインタSPのアドレスSP
(23:0)が内蔵RAM5を指定しているか否かの情
報を持つ。
Memory stack flag MS = 1: stack operation instruction Memory stack flag MS = 0: not stack operation instruction The hit flag HIT is set with the output of the address determination circuit 27 and the address SP of the stack pointer SP.
(23: 0) has information as to whether or not the internal RAM 5 is designated.

【0095】ヒットフラグHIT=1:内蔵RAM5の
配置されているアドレス ヒットフラグHIT=0:内蔵RAM5以外のアドレス 内蔵RAM5に対して、0番地から2047番地までの
2[Kバイト]が割り当てられている時には、スタック
ポインタSPの上位13ビットの各ビットの論理和の反
転をとることにより、アドレス判定を行なうことができ
る。
Hit flag HIT = 1: address where internal RAM 5 is located Hit flag HIT = 0: address other than internal RAM 5 2 [K bytes] from address 0 to address 2047 are allocated to internal RAM 5 When the stack pointer SP is present, the address determination can be performed by inverting the logical sum of the upper 13 bits of the stack pointer SP.

【0096】メモリスタックフラグMS=1で且つヒッ
トフラグHIT=1の時は、スタック操作命令でスタッ
ク領域が内蔵RAM5上にある場合であるので、バンク
転送バスBBUSを用いてスタック操作命令は、以下の
ように実行される。
When the memory stack flag MS = 1 and the hit flag HIT = 1, it means that the stack area is on the internal RAM 5 by the stack operation instruction. Therefore, the stack operation instruction using the bank transfer bus BBUS is as follows. It is executed like.

【0097】先ずプッシュ(PUSH)命令の動作は、
以下のように行なわれる。
First, the operation of the push (PUSH) instruction is as follows.
It is performed as follows.

【0098】(1) スタックポインタSPを内部バスに出
力し、演算回路ALUにセットする。 (2) 演算回路ALUで減算を行ない、スタックポインタ
SPをデクリメントする。
(1) The stack pointer SP is output to the internal bus and set in the arithmetic circuit ALU. (2) The arithmetic circuit ALU performs subtraction and decrements the stack pointer SP.

【0099】(3) 演算回路ALUの結果を内部バスに出
力し、スタックポインタSPをデクリメントした値をア
ドレスバッファAB及びスタックポインタSPにセット
する。 (4) プッシュするデータをデータバッファDBにセット
する。
(3) The result of the arithmetic circuit ALU is output to the internal bus, and the value obtained by decrementing the stack pointer SP is set in the address buffer AB and the stack pointer SP. (4) Set the data to be pushed in the data buffer DB.

【0100】(5) メモリスタックフラグMS=1、ヒッ
トフラグHIT=1であるので、バンク制御回路25に
スタックポインタSPのデータが入力され、バンクアド
レスバスBNKA(10:0)にアドレスとして出力さ
れる。またデータバッファDBのデータがバンク制御回
路25に入力され、書き込みデータとして使用される。
そしてバンク制御回路25に内蔵RAM5への書き込み
の指示が出される。
(5) Since the memory stack flag MS = 1 and the hit flag HIT = 1, the data of the stack pointer SP is input to the bank control circuit 25 and output as an address to the bank address bus BNKA (10: 0). It Further, the data in the data buffer DB is input to the bank control circuit 25 and used as write data.
Then, the bank control circuit 25 is instructed to write to the built-in RAM 5.

【0101】(6) バンク制御回路25は、指示に従って
バンクデータバスBNKD(63:0)のデータをバン
クアドレスバスBNKA(10:0)により指示される
内蔵RAM5上の位置に書き込む。
(6) The bank control circuit 25 writes the data of the bank data bus BNKD (63: 0) to the position on the internal RAM 5 designated by the bank address bus BNKA (10: 0) according to the instruction.

【0102】また、ポップ(POP)命令の動作は、以
下のように行なわれる。
The operation of the pop (POP) instruction is performed as follows.

【0103】(1) スタックポインタSPを内部バスに出
力し、アドレスバッファABにセットする。
(1) The stack pointer SP is output to the internal bus and set in the address buffer AB.

【0104】(2) メモリスタックフラグMS=1、ヒッ
トフラグHIT=1であるので、バンク制御回路25に
スタックポインタSPのデータが入力され、バンクアド
レスバスBNKA(10:0)にアドレスとして出力さ
れる。またバンク制御回路25に内蔵RAM5からの読
み込みの指示が出される。
(2) Since the memory stack flag MS = 1 and the hit flag HIT = 1, the data of the stack pointer SP is input to the bank control circuit 25 and output to the bank address bus BNKA (10: 0) as an address. It Further, the bank control circuit 25 is instructed to read from the built-in RAM 5.

【0105】(3) バンク制御回路25は、指示に従って
内蔵RAM5からバンクデータバスBNKD(63:
0)にデータを読み出すので、そのデータをデータバッ
ファDBにセットする。
(3) The bank control circuit 25 follows the instruction from the internal RAM 5 to the bank data bus BNKD (63:
Since the data is read to 0), the data is set in the data buffer DB.

【0106】(4) スタックポインタSPを内部バスに出
力し、演算回路ALUにセットする。 (5) 演算回路ALUで加算を行ない、スタックポインタ
SPをインクリメントする。
(4) The stack pointer SP is output to the internal bus and set in the arithmetic circuit ALU. (5) The arithmetic circuit ALU performs addition and increments the stack pointer SP.

【0107】(6) 演算回路ALUの結果を内部バスに出
力し、スタックポインタSPに書き戻す。
(6) The result of the arithmetic circuit ALU is output to the internal bus and written back to the stack pointer SP.

【0108】コール(CALL)命令では、プッシュ
(PUSH)命令と同様の操作で、バンク転送バスBB
USを介してプログラムカウンタPCの内容をスタック
にプッシュした後、アドレスバッファAB及びプログラ
ムカウンタPCに分岐先のアドレスをセットして、命令
フェッチを行ない、命令をデコードしてシーケンス制御
回路21を動作させ、サブルーチンの先頭の命令の処理
を開始する。
With the call (CALL) instruction, the bank transfer bus BB is operated by the same operation as the push (PUSH) instruction.
After the contents of the program counter PC are pushed onto the stack via the US, the branch destination address is set in the address buffer AB and the program counter PC to fetch the instruction, decode the instruction and operate the sequence control circuit 21. , Start processing the first instruction of the subroutine.

【0109】また、リターン(RET)命令では、ポッ
プ(POP)命令と同様の操作で、戻り先番地をバンク
転送バスBBUSを介してスタックからポップしてきた
後、それをプログラムカウンタPC及びアドレスバッフ
ァABにセットして、命令フェッチを行ない、戻り先プ
ログラムの命令の処理を開始する。
In the return (RET) instruction, after the return destination address is popped from the stack via the bank transfer bus BBUS by the same operation as the pop (POP) instruction, the popped address is returned to the program counter PC and the address buffer AB. To fetch the instruction and start processing the instruction of the return destination program.

【0110】更に、メモリスタックフラグMS=1、ヒ
ットフラグHIT=1以外の場合は、従来と同様に、シ
ステムバスを介して行なわれる。
Further, in cases other than the memory stack flag MS = 1 and the hit flag HIT = 1, the operation is performed via the system bus as in the conventional case.

【0111】次に、本発明の第2の実施例に係るデータ
処理装置について説明する。第2実施例のデータ処理装
置の概略構成は、第1の実施例とほぼ同様であるが、C
PUコアの構成が異なる。第2実施例のCPUコアの構
成図を図3に示す。
Next explained is a data processing device according to the second embodiment of the invention. The schematic configuration of the data processing device of the second embodiment is almost the same as that of the first embodiment, but C
The configuration of the PU core is different. A block diagram of the CPU core of the second embodiment is shown in FIG.

【0112】同図に示すように、CPUコア3’は、ス
タックポインタSP、プログラムカウンタPC、プロセ
ッサステータスワードPSW、汎用レジスタR0〜R1
5、バンクポインタCBP及びPBP、バンクスタック
ポインタBSP等のレジスタと、加算器、シフタ等の演
算回路ALUと、機械命令をデコードしてCPUコア3
の内部回路の動作を制御するシーケンス制御回路21
と、内部システムバスISBUSのインタフェース制御
を行なうバス制御回路23’と、アドレスバッファAB
と、データバッファDBと、バンク転送バスBBUSの
インタフェース制御を行なうバンク制御回路25’とか
ら構成されている。
As shown in the figure, the CPU core 3'includes a stack pointer SP, a program counter PC, a processor status word PSW, and general purpose registers R0 to R1.
5, bank pointers CBP and PBP, bank stack pointer BSP and other registers, adder, shifter and other arithmetic circuits ALU, machine instructions are decoded to make CPU core 3
Sequence control circuit 21 for controlling the operation of the internal circuit of
A bus control circuit 23 'for controlling the interface of the internal system bus ISBUS, and an address buffer AB.
, A data buffer DB, and a bank control circuit 25 'for controlling the interface of the bank transfer bus BBUS.

【0113】また、シーケンス制御回路21内には、C
PUコア3に割り込み信号INTが入力されて割り込み
処理時にレジスタの退避をメモリスタックに対して行な
うか、またはバンク(内蔵RAM5)に対して行なうか
を指定するスタック/バンクフラグSBを具備してい
る。
In the sequence control circuit 21, C
The PU core 3 is provided with a stack / bank flag SB that designates whether the interrupt signal INT is input and the registers are saved in the memory stack or in the bank (internal RAM 5) during interrupt processing. .

【0114】本実施例のCPUコア3’は、スタックポ
インタSP及びバンクポインタPBPがバンク制御回路
25’と接続され、バンク転送バスBBUSを介しての
データ転送が可能となっている点、バンクスタックポイ
ンタBSPが追加されて内部バスよりアクセス可能で、
また、バンク制御回路25’と接続されてバンク転送バ
スBBUSを介してのデータ転送が可能になっている点
が従来例(図6)と異なる。
In the CPU core 3'of this embodiment, the stack pointer SP and the bank pointer PBP are connected to the bank control circuit 25 ', and data transfer is possible via the bank transfer bus BBUS. A pointer BSP is added and can be accessed from the internal bus.
Further, it is different from the conventional example (FIG. 6) in that it is connected to the bank control circuit 25 ′ and data can be transferred via the bank transfer bus BBUS.

【0115】更に本実施例では、内蔵RAM5に対して
バンク転送バスBBUSよりスタック操作を行なう特別
な命令(PUSHB命令及びPOPB命令)を追加す
る。PUSHB命令及びPOPB命令は、バンクスタッ
クポインタBSPの指示する内蔵RAM5上のメモリ領
域にスタック操作を行なう命令で、オペランドとして6
4ビット分の複数レジスタを指定することができる。こ
れらのスタック操作命令のアセンブラフォーマット、並
びに動作仕様を以下に示す。
Further, in this embodiment, special instructions (PUSHB instruction and POPB instruction) for performing stack operation are added to the internal RAM 5 from the bank transfer bus BBUS. The PUSHB instruction and the POPB instruction are instructions that perform a stack operation in the memory area on the internal RAM 5 designated by the bank stack pointer BSP, and have 6 operands.
Multiple registers for 4 bits can be specified. The assembler format and operation specifications of these stack manipulation instructions are shown below.

【0116】(1)POPB命令:内蔵RAM5上のス
タック領域からの転送 [アセンブラフォーマット] POPB greg [動作] greg ←(BSP),BSP ← BS
P+1 バンクスタックポインタBSPで示された内蔵RAM5
のメモリ番地((BSP)!000)から8バイト分の
データがgregに転送され、バンクスタックポインタ
BSPが1だけインクリメントされる。
(1) POPB instruction: transfer from stack area on internal RAM 5 [assembler format] POPB greg [operation] greg ← (BSP), BSP ← BS
Built-in RAM 5 indicated by P + 1 bank stack pointer BSP
8 bytes of data are transferred from the memory address ((BSP)! 000) to greg, and the bank stack pointer BSP is incremented by 1.

【0117】(2)PUSHB命令:内蔵RAM5上の
スタック領域への転送 [アセンブラフォーマット] PUSHB greg [動作] BSP ← BSP−1,(BSP)← g
reg 先ずバンクスタックポインタBSPが1だけインクリメ
ントされ、次にバンクスタックポインタBSPが示す内
蔵RAM5のメモリ番地((BSP)!000)にgr
egのデータが転送される。
(2) PUSHB instruction: transfer to stack area on internal RAM 5 [assembler format] PUSHB greg [operation] BSP ← BSP-1, (BSP) ← g
reg First, the bank stack pointer BSP is incremented by 1, and then gr is stored in the memory address ((BSP)! 000) of the internal RAM 5 indicated by the bank stack pointer BSP.
The data of eg is transferred.

【0118】尚、gregで指定できるレジスタは、図
4に示す通りである。
The registers that can be specified by greg are as shown in FIG.

【0119】PUSHB命令は、以下のようにCPUコ
ア3内部で処理される。
The PUSHB instruction is processed inside the CPU core 3 as follows.

【0120】(1) バンクスタックポインタBSPを内部
バスに出力し、演算回路ALUにセットする。
(1) The bank stack pointer BSP is output to the internal bus and set in the arithmetic circuit ALU.

【0121】(2) 演算回路ALUで減算を行ない、バン
クスタックポインタBSPをデクリメントする。
(2) The arithmetic circuit ALU performs subtraction to decrement the bank stack pointer BSP.

【0122】(3) 演算回路ALUの結果を内部バスに出
力し、デクリメントした値をバンクスタックポインタB
SPに書き戻す。
(3) The result of the arithmetic circuit ALU is output to the internal bus, and the decremented value is the bank stack pointer B.
Write back to SP.

【0123】(4) バンク制御回路25’に対して、gr
egで指定されるレジスタ群の内容をバンクデータバス
BNKD(63:0)に出力させ、また、バンクスタッ
クポインタBSPから生成される内蔵RAM5のアドレ
ス((BSP)!000)をバンクアドレスバスBNK
A(10:0)に出力するよう指示し、書き込みの指示
を出す。
(4) For the bank control circuit 25 ', gr
The contents of the register group specified by eg are output to the bank data bus BNKD (63: 0), and the address ((BSP)! 000) of the internal RAM 5 generated from the bank stack pointer BSP is output to the bank address bus BNK.
The output is instructed to A (10: 0), and the writing is instructed.

【0124】(5) バンク制御回路25’は、指示に従っ
てバンクデータバスBNKD(63:0)のデータをバ
ンクアドレスバスBNKA(10:0)により指示され
る内蔵RAM5上の位置に書き込む。
(5) The bank control circuit 25 'writes the data of the bank data bus BNKD (63: 0) to the position on the internal RAM 5 designated by the bank address bus BNKA (10: 0) according to the instruction.

【0125】また、POPB命令の動作は、以下のよう
に行なわれる。
The operation of the POPB instruction is performed as follows.

【0126】(1) スタックポインタSPを内部バスに出
力し、アドレスバッファABにセットする。
(1) The stack pointer SP is output to the internal bus and set in the address buffer AB.

【0127】(2) バンク制御回路25’に対して、バン
クアドレスバスBNKA(10:0)に内蔵RAM5の
読み出しアドレスとして((BSP)!000)という
アドレスを出力させ、内蔵RAM5の読み出しの指示を
出す。
(2) The bank control circuit 25 'is made to output the address ((BSP)! 000) as the read address of the internal RAM 5 to the bank address bus BNKA (10: 0), and the instruction to read the internal RAM 5 is issued. Give out.

【0128】(3) バンク制御回路25’は、指示に従っ
て内蔵RAM5からバンクデータバスBNKD(63:
0)にデータを読み出すので、そのデータをgregで
指定されるレジスタ群に書き込む。
(3) The bank control circuit 25 'follows the bank data bus BNKD (63:
Since the data is read to 0), the data is written to the register group designated by greg.

【0129】(4) バンクスタックポインタBSPを内部
バスに出力し、演算回路ALUにセットする。
(4) The bank stack pointer BSP is output to the internal bus and set in the arithmetic circuit ALU.

【0130】(5) 演算回路ALUで加算を行ない、バン
クスタックポインタBSPをインクリメントする。
(5) The arithmetic circuit ALU performs addition, and the bank stack pointer BSP is incremented.

【0131】(6) 演算回路ALUの結果を内部バスに出
力し、バンクスタックポインタBSPに書き戻す。
(6) The result of the arithmetic circuit ALU is output to the internal bus and written back to the bank stack pointer BSP.

【0132】[0132]

【発明の効果】以上のように本発明によれば、中央処理
装置において、アドレス判定手段により、スタックポイ
ンタの示すアドレスが当該データ処理装置におけるアド
レス空間内の第1の記憶手段に対するアドレス範囲にあ
るか否かを判定し、スタックポインタの示すアドレスが
第1の記憶手段に対するアドレス範囲にあると判定され
た場合には、バンク制御手段により、スタック操作命令
に伴うスタック領域への読み書きを、専用のバスを介し
て行なうよう制御することとしたので、スタックポイン
タが示しているアドレスを自動的に判定し、スタック領
域が第1の記憶手段の領域にある場合には、中央処理装
置と第1の記憶手段間の専用のバスを用いて高速に読み
書きすることができ、結果として、高速なスタック操作
を容易に行ない得る、低コストでシステム性能の向上し
たデータ処理装置を提供することができる。
As described above, according to the present invention, in the central processing unit, the address determination means causes the address indicated by the stack pointer to be within the address range for the first storage means in the address space of the data processing apparatus. If it is determined that the address indicated by the stack pointer is within the address range for the first storage means, the bank control means performs exclusive read / write access to the stack area accompanying the stack operation instruction. Since the control is performed via the bus, the address indicated by the stack pointer is automatically determined. If the stack area is in the area of the first storage means, the central processing unit and the first It is possible to read and write at high speed using a dedicated bus between storage means, and as a result, high-speed stack operation can be easily performed. , It is possible to provide a data processing device with improved system performance at low cost.

【0133】また、本発明の第2及び第3の特徴のデー
タ処理装置では、中央処理装置の一機械命令として、バ
ンクスタックポインタの指示する第1の記憶手段のアド
レスに対して、当該中央処理装置内の複数のレジスタの
保持するデータを専用のバスを介して一度にデータ転送
して、スタック操作を行なう機械命令を備え、該機械命
令発行時には、バンク制御手段によりバンクスタックポ
インタBSPの示すアドレスに基づき、第1の記憶手段
におけるスタック領域への読み書きを専用のバスを介し
て行なうよう制御することとしたので、前記機械命令発
行時には、第1の記憶手段上のスタック領域に対して、
中央処理装置内のレジスタ群の保持するデータの読み出
し及び書き込みを専用のバスで高速に行なうことがで
き、結果として、高速なスタック操作を容易に行ない得
る、低コストでシステム性能の向上したデータ処理装置
を提供することができる。
Further, in the data processor of the second and third features of the present invention, as one machine instruction of the central processing unit, the central processing is performed for the address of the first storage means designated by the bank stack pointer. A machine instruction for performing stack operation by transferring data held by a plurality of registers in the device at a time via a dedicated bus is provided, and at the time of issuing the machine instruction, the address indicated by the bank stack pointer BSP by the bank control means. Based on the above, it is decided that reading and writing from and to the stack area in the first storage means are controlled via a dedicated bus. Therefore, when issuing the machine instruction, the stack area in the first storage means is
Data held by the registers in the central processing unit can be read and written at high speed with a dedicated bus, and as a result, high-speed stack operation can be performed easily, and data processing with improved system performance at low cost can be performed. A device can be provided.

【0134】更に、データ処理装置におけるサブルーチ
ンコールの高速化、割り込み発生時のコンテキストスイ
ッチの高速化が実現され、システム性能の向上を図るこ
とができる。
Further, the speed of the subroutine call in the data processing device and the speed of the context switch when an interrupt occurs are realized, and the system performance can be improved.

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

【図1】本発明の原理説明図、または本発明の第1及び
第2の実施例に係るデータ処理装置の構成図である。
FIG. 1 is a diagram illustrating the principle of the present invention or a configuration diagram of a data processing device according to first and second embodiments of the present invention.

【図2】本発明の第1の実施例に係るデータ処理装置の
CPUコアの詳細構成図である。
FIG. 2 is a detailed configuration diagram of a CPU core of the data processing device according to the first embodiment of the present invention.

【図3】本発明の第2の実施例に係るデータ処理装置の
CPUコアの詳細構成図である。
FIG. 3 is a detailed configuration diagram of a CPU core of the data processing device according to the second embodiment of the present invention.

【図4】第2の実施例のデータ処理装置におけるPOP
B命令及びPUSHB命令のgregで指定できるレジ
スタの一覧表である。
FIG. 4 is a POP in the data processing device according to the second embodiment.
6 is a list of registers that can be specified by greg of a B instruction and a PUSHB instruction.

【図5】従来のデータ処理装置の構成図である。FIG. 5 is a configuration diagram of a conventional data processing device.

【図6】従来のデータ処理装置のCPUコアの詳細構成
図である。
FIG. 6 is a detailed configuration diagram of a CPU core of a conventional data processing device.

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

1 マイクロプロセッサ(MPU) 3,3’,103 中央処理装置(CPUコア) 5,105 第1の記憶手段(内蔵RAM) 7 第2の記憶手段(内蔵ROM) 8,108 バスインタフェース 9,109 外部メモリ 11 バス制御手段 13,13’ バンク制御手段 15 アドレス判定手段 SP スタックポインタ BSP バンクスタックポインタ SBUS システムバス OSBUS 外部システムバス OD(15:0) データバス OA(23:0) アドレスバス OC(5:0) 制御信号バス ISBUS 内部システムバス ID(15:0) データバス IA(23:0) アドレスバス IC(5:0) 制御信号バス BBUS 専用のバス(バンク転送バス) BNKD(63:0) バンクデータバス BNKA(10:0) バンクアドレスバス BNKC(3:0) バンク制御信号バス INT 割り込み信号 PC プログラムカウンタ PSW プロセッサステータスワード R0〜R15 汎用レジスタ CBP,PBP バンクポインタ ALU 演算回路 21 シーケンス制御回路 23,23’,123 バス制御回路 AB アドレスバッファ DB データバッファ 25,25’,125 バンク制御回路 27 アドレス判定回路 HIT ヒットフラグ MS メモリスタックフラグ SB スタック/バンクフラグ 1 Microprocessor (MPU) 3,3 ', 103 Central Processing Unit (CPU Core) 5,105 First Storage Means (Built-in RAM) 7 Second Storage Means (Built-in ROM) 8,108 Bus Interface 9,109 External Memory 11 Bus control means 13, 13 'Bank control means 15 Address determination means SP Stack pointer BSP Bank stack pointer SBUS System bus OSBUS External system bus OD (15: 0) Data bus OA (23: 0) Address bus OC (5: 0) Control signal bus ISBUS Internal system bus ID (15: 0) Data bus IA (23: 0) Address bus IC (5: 0) Control signal bus BBUS Dedicated bus (bank transfer bus) BNKD (63: 0) Bank Data bus BNKA (10: 0) Bank address B BNKC (3: 0) Bank control signal bus INT interrupt signal PC program counter PSW processor status word R0 to R15 general purpose register CBP, PBP bank pointer ALU arithmetic circuit 21 sequence control circuit 23, 23 ', 123 bus control circuit AB address buffer DB data buffer 25, 25 ', 125 bank control circuit 27 address determination circuit HIT hit flag MS memory stack flag SB stack / bank flag

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 プログラムの処理を行なう中央処理装置
と、 バンクとして使用される第1の記憶手段と、 前記プログラムを保持する第2の記憶手段とを有し、 前記中央処理装置、第1の記憶手段、及び第2の記憶手
段は、システムバスで接続され、前記中央処理装置及び
第1の記憶手段は、専用のバスで接続され、 前記中央処理装置は、 スタックポインタと、 前記スタックポインタの示すアドレスが、当該データ処
理装置におけるアドレス空間内の前記第1の記憶手段に
対するアドレス範囲にあるか否かを判定するアドレス判
定手段と、 前記アドレス判定手段により、前記スタックポインタの
示すアドレスが、前記第1の記憶手段に対するアドレス
範囲にあると判定された場合には、スタック操作命令に
伴うスタック領域への読み書きを、前記専用のバスを介
して行なうよう制御するバンク制御手段とを有すること
を特徴とするデータ処理装置。
1. A central processing unit for processing a program, a first storage unit used as a bank, and a second storage unit for holding the program, wherein the central processing unit and the first storage unit are provided. The storage unit and the second storage unit are connected by a system bus, the central processing unit and the first storage unit are connected by a dedicated bus, and the central processing unit includes a stack pointer and a stack pointer. An address determination unit that determines whether the address indicated is within the address range for the first storage unit in the address space of the data processing device, and the address indicated by the stack pointer is determined by the address determination unit. If it is determined to be within the address range for the first storage means, read / write to / from the stack area accompanying the stack operation instruction is performed. The data processing apparatus characterized by having a bank control means for controlling to perform via the bus of the dedicated.
【請求項2】 プログラムの処理を行なう中央処理装置
と、 バンクとして使用される第1の記憶手段と、 前記プログラムを保持する第2の記憶手段とを有し、 前記中央処理装置、第1の記憶手段、及び第2の記憶手
段は、システムバスで接続され、前記中央処理装置及び
第1の記憶手段は、専用のバスで接続され、 前記中央処理装置は、 前記第1の記憶手段に対して、前記専用のバスを介して
アクセスするためのアドレスを保持するバンクスタック
ポインタと、 前記バンクスタックポインタの示すアドレスに基づき、
前記第1の記憶手段におけるスタック領域への読み書き
を、前記専用のバスを介して行なうよう制御するバンク
制御手段とを有し、 前記バンクスタックポインタの指示する前記第1の記憶
手段のアドレスに対して、当該中央処理装置内の複数の
レジスタの保持するデータを前記専用のバスを介して一
度にデータ転送して、スタック操作を行なう機械命令を
備えることを特徴とするデータ処理装置。
2. A central processing unit that processes a program, a first storage unit that is used as a bank, and a second storage unit that holds the program, the central processing unit and the first storage unit. The storage unit and the second storage unit are connected by a system bus, the central processing unit and the first storage unit are connected by a dedicated bus, and the central processing unit is connected to the first storage unit. A bank stack pointer holding an address for accessing via the dedicated bus, and an address indicated by the bank stack pointer,
Bank control means for controlling reading and writing to and from the stack area in the first storage means via the dedicated bus, and with respect to an address of the first storage means designated by the bank stack pointer. And a machine instruction for performing stack operation by transferring data held by a plurality of registers in the central processing unit at a time via the dedicated bus.
【請求項3】 前記中央処理装置、第1の記憶手段、及
び第2の記憶手段は、ワンチップ上に構成されることを
特徴とする請求項1または2に記載のデータ処理装置。
3. The data processing device according to claim 1, wherein the central processing unit, the first storage unit, and the second storage unit are configured on a single chip.
JP28142192A 1992-10-20 1992-10-20 Data processor Pending JPH06131250A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28142192A JPH06131250A (en) 1992-10-20 1992-10-20 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28142192A JPH06131250A (en) 1992-10-20 1992-10-20 Data processor

Publications (1)

Publication Number Publication Date
JPH06131250A true JPH06131250A (en) 1994-05-13

Family

ID=17638930

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28142192A Pending JPH06131250A (en) 1992-10-20 1992-10-20 Data processor

Country Status (1)

Country Link
JP (1) JPH06131250A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015133126A (en) * 2007-11-02 2015-07-23 クゥアルコム・インコーポレイテッドQualcomm Incorporated Method and system for accelerating procedure return sequences

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015133126A (en) * 2007-11-02 2015-07-23 クゥアルコム・インコーポレイテッドQualcomm Incorporated Method and system for accelerating procedure return sequences

Similar Documents

Publication Publication Date Title
US4715013A (en) Coprocessor instruction format
US4729094A (en) Method and apparatus for coordinating execution of an instruction by a coprocessor
JPH1091443A (en) Information processing circuit, microcomputer and electronic equipment
JP3707581B2 (en) Data processing system having self-aligned stack pointer and method thereof
US6986028B2 (en) Repeat block with zero cycle overhead nesting
US4821231A (en) Method and apparatus for selectively evaluating an effective address for a coprocessor
JPH07120338B2 (en) Method for a data processor to coordinate the execution of instructions by a coprocessor and the data processor
JP4465081B2 (en) Efficient sub-instruction emulation in VLIW processor
EP0385136B1 (en) Microprocessor cooperating with a coprocessor
US6502181B1 (en) Method and apparatus for an enhanced processor
CA1287177C (en) Microprogrammed systems software instruction undo
JPH06131250A (en) Data processor
JPH10124312A (en) Central processor
US20050216708A1 (en) Processor for performing context switching, a method for performing context switching, a computer program for perform context switching
EP0915416B1 (en) System for allowing a two word instruction to be executed in a single cycle and method therefor
JPH0377137A (en) Information processor
JPH0635800A (en) Microprocessor and data processing system using it
US20230315456A1 (en) Processing apparatus
JPS59218569A (en) Microcomputer
JPH0524537B2 (en)
US4811274A (en) Method and apparatus for selectively evaluating an effective address for a coprocessor
EP0401745A2 (en) Data processor for high-speed access to stack area data
JP2696578B2 (en) Data processing device
JP2000194554A (en) Arithmetic processor
JP3239042B2 (en) Microcomputer