JPH01216428A - System for executing subroutine of memory bank - Google Patents

System for executing subroutine of memory bank

Info

Publication number
JPH01216428A
JPH01216428A JP63041535A JP4153588A JPH01216428A JP H01216428 A JPH01216428 A JP H01216428A JP 63041535 A JP63041535 A JP 63041535A JP 4153588 A JP4153588 A JP 4153588A JP H01216428 A JPH01216428 A JP H01216428A
Authority
JP
Japan
Prior art keywords
bank
memory
address
subroutine
bank switching
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
JP63041535A
Other languages
Japanese (ja)
Inventor
Yutaka Kaneko
豊 金子
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP63041535A priority Critical patent/JPH01216428A/en
Priority to US07/313,677 priority patent/US5146581A/en
Priority to CN 89101867 priority patent/CN1015495B/en
Priority to EP89103296A priority patent/EP0330226B1/en
Priority to KR1019890002294A priority patent/KR920006614B1/en
Priority to DE68924719T priority patent/DE68924719T2/en
Publication of JPH01216428A publication Critical patent/JPH01216428A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To make address adjustment at plural parts unnecessary and to reduce the developing time of a program by storing the address of a subroutine in a memory bank to be executed at a prescribed register first in a main routine on one side. CONSTITUTION:In the specific same address areas 9 of the memory banks 1 and 2, a bank switching control program, that is a bank switching manager is stored, and in a processing program area 10 behind the area 9, a different processing program is stored. In the memory bank 1, when the bank switching manager is called in the main routine after transferring an address Y to a register BX, the bank is switched from 1 to 2 by the bank switching manager, and the subroutine starting from the address Y set in the register BX is called by the bank switching manager of the memory bank 2, and the subroutine is executed. In such a way, it is possible to make complicated address adjust ment between the memory banks unnecessary, and to improve the working efficiency of program development.

Description

【発明の詳細な説明】 (イ)産業上の利用分野 本発明は、異なる処理プログラムを各々第1及び第2の
メモリバンクに記憶するシステムにおいて、一方のメモ
リバンク内のメインルーチンから他方のメモリバンク内
のサブルーチンを呼出し実行するメモリバンクのサブル
ーチン実行方式に関する′。
DETAILED DESCRIPTION OF THE INVENTION (A) Industrial Application Field The present invention provides a system in which different processing programs are stored in first and second memory banks. This paper relates to a memory bank subroutine execution method that calls and executes subroutines within the bank.

(ロ)従来の技術 中央処理装置(以下、CPUと呼ぶ)のメモリ領域を拡
張する方式として、一般的にメモリバンク切替方式が用
いられており、これらメモリバンク内に異なる処理プロ
グラムを記憶することも従来より行われている。そして
、これらメモリバンクの切替は、通常、メモリバンク外
のメインメモリ上の共通エリアに、メモリバンク切替用
の制御プログラムを用意し、この制御プログラムによっ
て実行していた。
(b) Conventional technology A memory bank switching method is generally used as a method to expand the memory area of a central processing unit (hereinafter referred to as CPU), and different processing programs are stored in these memory banks. This has also been done conventionally. Usually, a control program for memory bank switching is prepared in a common area on the main memory outside the memory banks, and the switching of these memory banks is executed by this control program.

ところが、プログラムエリアに制約があって、メインメ
モリ上にこのような共通エリアをとれないシステムでは
、メモリバンク内でバンクの切替制御を実行しなくては
ならない、そこで、従来は、例えば、特開昭62−12
0543号公報の第3図に開示されているように、一方
のメモリバンクのメインルーチンにおいて、バンクを切
替ようとするアドレスXでバンク切替命令を実行し、他
方のメモリバンクの次のアドレスX+1もしくはX+2
へ実行を移すという方式を採用していた。
However, in systems where the program area is restricted and such a common area cannot be allocated on the main memory, bank switching control must be executed within the memory bank. 1986-12
As disclosed in FIG. 3 of Publication No. 0543, in the main routine of one memory bank, a bank switching instruction is executed at the address X at which the bank is to be switched, and the next address X+1 or X+2
A method was adopted in which the execution was transferred to

(八)発明が解決しようとする課題 上記公報第3図に開示されている切替方式を用いて、一
方のメモリバンクのメインルーチンから他方のメモリバ
ンクのサブルーチンを呼出し実行しようとすると、プロ
グラムを開発する際、メインルーチンのバンク切替アド
レスとサブルーチンの先頭アドレスとを、メインルーチ
ンがサブルーチンを呼出そうとする複数箇所で、−々ア
ドレス合せを行わなければならず、このため、プログラ
ム開発に多大の時間が必要になり、更には、アドレスを
合せなければならないという制約のため、呼出そうとす
るサブルーチンの数が多い場合には、所望とするプログ
ラムの開発が行えないという事態にまでなり得る。
(8) Problems to be Solved by the Invention When attempting to call and execute a subroutine of the other memory bank from the main routine of one memory bank using the switching method disclosed in Figure 3 of the above publication, the program development When doing so, the bank switching address of the main routine and the start address of the subroutine must be matched at multiple locations where the main routine attempts to call the subroutine, which requires a lot of time in program development. Moreover, if there are many subroutines to be called, it may become impossible to develop the desired program due to the restriction that the addresses must match.

しかしながら、メモリバンク内で使用するサブルーチン
を単に各々、自己のメモリバンク内に全て記憶させよう
とすれば、必要とするメモリ容量が増大し、制約された
プログラムメモリエリア内には所望のプログラムを格納
しきれなくなってしまう。
However, if you try to simply store all the subroutines used in a memory bank in its own memory bank, the required memory capacity will increase, and only the desired program can be stored in the restricted program memory area. I can't bear it anymore.

(ニ)課題を解決するための手段 本発明は、処理プログラムを記憶する第1及び第2のメ
モリバンクを備え、該両メモリバンクの特定の同一アド
レスエリアにバンク切替制御プログラムを記憶し、一方
のメモリバンクにおける前記処理プログラム中のメイン
ルーチンで、実行スベき他方のメモリバンクにおけるサ
ブルーチンのアドレスを所定のレジスタに格納し、格納
後、同一メモリバンク内の前記バンク切替制御プログラ
ムを呼出すようにすると共に、該メインルーチン側の前
記バンク切替制御プログラムには、バンク切替命令及び
メインルーチンへの復帰命令を記憶し、且つ、前記サブ
ルーチン側の前記バンク切替制御プログラムには、前記
バンク切替命令実行後に前記所定のレジスタに格納した
先頭アドレスから始まるサブルーチンを呼出す命令と、
該命令による前記サブルーチンの実行後にバンクを切替
えるバンク切替命令とを記憶し、該バンク切替命令実行
後前記復帰命令を実行することにより、一方のメインル
ーチンから他方のサブルーチンを呼出し実行することを
実現するものであり、この方式により上記課題を解決す
る。
(D) Means for Solving the Problems The present invention comprises first and second memory banks for storing processing programs, stores a bank switching control program in the same specific address area of both memory banks, and The main routine in the processing program in the memory bank stores the address of the subroutine in the other memory bank to be executed in a predetermined register, and after storing, calls the bank switching control program in the same memory bank. At the same time, the bank switching control program on the main routine side stores a bank switching command and a return command to the main routine, and the bank switching control program on the subroutine side stores the above command after executing the bank switching command. An instruction to call a subroutine starting from the first address stored in a predetermined register,
A bank switching instruction for switching banks after execution of the subroutine by the instruction is stored, and the return instruction is executed after the execution of the bank switching instruction, thereby realizing calling and executing the other subroutine from one main routine. This method solves the above problem.

(*〉作用 本発明では、一方のメインルーチンで、実行すべき他方
のメモリバンク内のサブルーチンのアドレスが所定レジ
スタに先ず格納され、格納後、自己のメモリバンク内の
バンク切替制御プログラムによって、特定アドレスエリ
ア内でバンクが切替えられ、切替えられたメモリバンク
のバンク切替制御プログラムにより、同一バンク内のサ
ブルーよって、上記特定アドレスエリア内でバンク切替
が行われ、切替られたメモリバンクの共ンク切替制御プ
ログラムによってメインルーチンへの復帰が行われる。
(*> Effect In the present invention, in one main routine, the address of the subroutine in the other memory bank to be executed is first stored in a predetermined register, and after being stored, the address of the subroutine to be executed in the other memory bank is specified by the bank switching control program in the own memory bank. Banks are switched within the address area, and the bank switching control program of the switched memory bank performs bank switching within the above-mentioned specific address area by the subroutine within the same bank, and common link switching control of the switched memory bank is performed. The program returns to the main routine.

(へ)実施例 第2図は、本発明の実施例を実現するためのス、(4)
は第1処理プログラムを記憶するメモリバンク1として
のROM、(5)は第2処理プログラムを記憶するメモ
リバンク2としてのROM。
(v) Embodiment FIG. 2 shows the steps for realizing the embodiment of the present invention. (4)
(5) is a ROM serving as a memory bank 1 that stores a first processing program, and (5) a ROM serving as a memory bank 2 that stores a second processing program.

(6)は種々のデータ及び外部装置からロードされるユ
ーザープログラム等を記憶するためのメインメモリとし
てのRAM、(7)はCP U(1)が後述のバンク切
替命令を実行することにより、バンクを指定するバンク
指定データがセットされるバンクレジスタ、(8)はバ
ンクレジスタ(7)の内容に応じて、いずれか与一方の
メモリバンクを選択するデコーダであって、ハードウェ
ア構成は一般的な構成である。尚、同−ROMチップを
用いて2以上のメモリバンクを構成するときは、特願昭
61−252195号公報に開示きれている構成でも良
く、これら構成は本願の要旨とは関係しないものである
(6) is a RAM as a main memory for storing various data and user programs loaded from external devices, and (7) is a RAM that is used as a main memory for storing various data and user programs loaded from external devices. The bank register (8) is a decoder that selects one of the given memory banks according to the contents of the bank register (7), and the hardware configuration is a typical one. It is the composition. When configuring two or more memory banks using the same ROM chip, the configuration disclosed in Japanese Patent Application No. 61-252195 may be used, and these configurations are not related to the gist of the present application. .

第1図は、メモリバンク1 (4)及びメモリバンク2
(5)のプログラム内容を示す図であり、両メモリバン
クの特定の同一アドレスエリア(9)にバンク切替制御
プログラム(以下、バンク切替マネジャーと呼ぶ)を記
憶し、該エリア(9)以降の処理プログラムエリア(1
0)に各々、異なる処理プログラムを記憶している。
Figure 1 shows memory bank 1 (4) and memory bank 2.
(5) is a diagram showing the program contents, in which a bank switching control program (hereinafter referred to as bank switching manager) is stored in the same specific address area (9) of both memory banks, and the processing from the area (9) onwards. Program area (1
0) respectively store different processing programs.

以下、メモリバンク1(4)のメインルーチンから、メ
モリバンク2(5)のサブルーチンを呼出し実行する例
について説明する。
An example of calling and executing a subroutine of memory bank 2 (5) from the main routine of memory bank 1 (4) will be described below.

先ず、メモリバンク2内には、複数のサブルーチン5U
BI、5U−B2.・・・・旧・・が、メモリバンク1
のメインルーチンのサブルーチン呼出しアドレスとは無
関係に記憶されており、このメインルーチンでは、例え
ば、サブルーチン5UB1を呼出そうとするアドレスX
に、サブルーチン5UB1のアドレスYをレジスタBX
に転送するMO■命令が、そして、次のアドレスX+1
にアドレスOから始まるバンク切替マネジャーを呼出す
CALL命令が記憶されている。
First, in the memory bank 2, there are a plurality of subroutines 5U.
BI, 5U-B2. ...old... is memory bank 1
For example, in this main routine, the address X to call subroutine 5UB1 is stored independently of the subroutine call address of the main routine
, set address Y of subroutine 5UB1 to register BX.
The MO■ instruction to transfer to the next address
A CALL command to call the bank switching manager starting from address O is stored in .

又、メモリバンク1のバンク切替マネジャーには、アド
レス0にバンクを1から2に切替えるバンク切替命令、
アドレス1にJMP#、アドレス2〜4にNOP命令、
アドレス5にRET命令が記憶きれている。一方、メモ
リバンク2のバンク切替マネジャーには、アドレス0,
1.5にN。
Furthermore, the bank switching manager of memory bank 1 has a bank switching command to switch the bank from 1 to 2 at address 0;
JMP# at address 1, NOP command at addresses 2 to 4,
The RET command has been stored at address 5. On the other hand, the bank switching manager of memory bank 2 has addresses 0,
N to 1.5.

P命令、アドレス3にレジスタBXにセットされたアド
レスから始まるサブルーチンを呼出すCALL命令、ア
ドレス4にバンクを2から1に切替えるバンク切替命令
、アドレス5にJMPI!+が記憶されている。
P instruction, address 3 is a CALL instruction that calls a subroutine starting from the address set in register BX, address 4 is a bank switching instruction that switches the bank from 2 to 1, address 5 is JMPI! + is memorized.

従って、メモリバンク1でメインルーチンにおいて、ア
ドレスYをレジスタBXに転送後、バンク切替マネジャ
ーを呼出すと、このバンク切替マネジャーによって、バ
ンクが1から2に切替えられ、切替後、メモリバンク2
のバンク切替マネジャーにより、レジスタBXにセット
きれたアドレス、即ちアドレスYから始まるサブルーチ
ンが呼出きれ、このサブルーチンが実行きれる。実行後
、RET命令によりバンク切替マネジャーに復帰し、該
マネジ〜−により、バンクが2から1に切替られ、切替
後、メモリバンクlのバンク切替マネジャー内の゛RE
T命令が実行され、メインルーチンのアドレスX+2へ
復帰する。つまり、一方のメモリバンクのメインルーチ
ンから他方のメモリバンクのサブルーチンを呼出し実行
することが実現される。サブルーチン5UB2を呼出す
場合は、MOV命令でレジスタBXに5UB2のアドレ
スWを転送すれば良い。
Therefore, in the main routine in memory bank 1, when the bank switching manager is called after transferring address Y to register BX, the bank switching manager switches the bank from 1 to 2, and after switching, memory bank 2
The bank switching manager allows the subroutine starting from the address set in register BX, that is, address Y, to be called completely, and this subroutine can be completely executed. After execution, the RET command returns to the bank switching manager, the bank is switched from 2 to 1 by the manager ~-, and after the switching, 'RE' in the bank switching manager of memory bank l is
The T instruction is executed and the process returns to address X+2 of the main routine. In other words, the main routine of one memory bank can call and execute the subroutine of the other memory bank. When subroutine 5UB2 is called, address W of 5UB2 may be transferred to register BX using the MOV instruction.

ところで、メモリバンク2のメインルーチンからも相互
にメモリバンク1のサブルーチンを呼出せるようにする
には、エリア(9)を倍に拡大して、メモリバンク1と
同様のバンク切替マネジャーをメモリバンク2に、そし
て、メモリバンク2と同様のバンク切替マネジャーをメ
モリバンク1にも遠 番加し、且つ、メモリバンク2のメインルーチンでメモ
リバンク1のメインルーチンと同様、MOV命令及び追
加したバンク切替マネジャーを呼出すCALL命令を実
行するようにすれば良い。
By the way, in order to be able to mutually call the subroutines of memory bank 1 from the main routine of memory bank 2, double the area (9) and use the same bank switching manager as that of memory bank 1 in memory bank 2. Then, a bank switching manager similar to that of memory bank 2 is added remotely to memory bank 1, and the main routine of memory bank 2 uses the MOV command and the added bank switching manager in the same way as the main routine of memory bank 1. All you have to do is execute a CALL instruction that calls .

(ト)発明の効果 本発明に依れば、メモリバンク間での面倒なアドレス合
せが不要となり、サブルーチンをメモリバンク内の任意
のアドレスに配置できるようになり、このため、プログ
ラム開発の作業効率が向上する。
(G) Effects of the Invention According to the present invention, there is no need for troublesome address matching between memory banks, and subroutines can be placed at any address within the memory bank, which improves work efficiency in program development. will improve.

更に、特定のアドレスエリア内で常にバンク切替が実行
できるので、切替を行うためのプログラムエリアを削減
できる。
Furthermore, since bank switching can always be performed within a specific address area, the program area for switching can be reduced.

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

第1図は本発明の詳細な説明図、第2図は実施例のハー
ドウェア構成を示すブロック図である。 (1)・・・CPU、  (2)・・・アドレスバス、
(3)・・・データバス、(4)・・・メモリバンク1
、(5)・・・メモリバンク2、(7)・・・バンクレ
ジスタ。
FIG. 1 is a detailed explanatory diagram of the present invention, and FIG. 2 is a block diagram showing the hardware configuration of the embodiment. (1)...CPU, (2)...Address bus,
(3)...Data bus, (4)...Memory bank 1
, (5)...Memory bank 2, (7)...Bank register.

Claims (1)

【特許請求の範囲】[Claims] (1)処理プログラムを記憶する第1及び第2のメモリ
バンクを備え、該両メモリバンクの特定の同一アドレス
エリアにバンク切替制御プログラムを記憶し、一方のメ
モリバンクにおける前記処理プログラム中のメインルー
チンで、実行すべき他方のメモリバンクにおけるサブル
ーチンのアドレスを所定のレジスタに格納し、格納後、
同一メモリバンク内の前記バンク切替制御プログラムを
呼出すようにすると共に、該メインルーチン側の前記バ
ンク切替制御プログラムには、バンク切替命令及びメイ
ンルーチンへの復帰命令を記憶し、且つ、前記サブルー
チン側の前記バンク切替制御プログラムには、前記バン
ク切替命令実行後に前記所定のレジスタに格納した先頭
アドレスから始まるサブルーチンを呼出す命令と、該命
令による前記サブルーチンの実行後にバンクを切替える
バンク切替命令とを記憶し、該バンク切替命令実行後前
記復帰命令を実行することにより、一方のメインルーチ
ンから他方のサブルーチンを呼出し実行することを特徴
としたメモリバンクのサブルーチン実行方式。
(1) comprising first and second memory banks for storing processing programs, storing a bank switching control program in the same specific address area of both memory banks, and storing a main routine in the processing program in one memory bank; Then, store the address of the subroutine in the other memory bank to be executed in a predetermined register, and after storing,
The bank switching control program in the same memory bank is called, and the bank switching control program on the main routine side stores a bank switching instruction and a return instruction to the main routine, and the bank switching control program on the main routine side stores a bank switching instruction and a return instruction to the main routine. The bank switching control program stores an instruction to call a subroutine starting from a start address stored in the predetermined register after executing the bank switching instruction, and a bank switching instruction to switch banks after executing the subroutine according to the instruction, A subroutine execution method for a memory bank, characterized in that one main routine calls and executes another subroutine by executing the return instruction after executing the bank switching instruction.
JP63041535A 1988-02-24 1988-02-24 System for executing subroutine of memory bank Pending JPH01216428A (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP63041535A JPH01216428A (en) 1988-02-24 1988-02-24 System for executing subroutine of memory bank
US07/313,677 US5146581A (en) 1988-02-24 1989-02-22 Subprogram executing data processing system having bank switching control storing in the same address area in each of memory banks
CN 89101867 CN1015495B (en) 1988-02-24 1989-02-24 Data processing system of using storage location conversion mode and method thereof
EP89103296A EP0330226B1 (en) 1988-02-24 1989-02-24 Apparatus of and method for executing subprogram in bank switching data processing system
KR1019890002294A KR920006614B1 (en) 1988-02-24 1989-02-24 Bank switching scheme and data processing system thereof
DE68924719T DE68924719T2 (en) 1988-02-24 1989-02-24 Device and method for executing a subroutine in a data processing system with block switching.

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63041535A JPH01216428A (en) 1988-02-24 1988-02-24 System for executing subroutine of memory bank

Publications (1)

Publication Number Publication Date
JPH01216428A true JPH01216428A (en) 1989-08-30

Family

ID=12611106

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63041535A Pending JPH01216428A (en) 1988-02-24 1988-02-24 System for executing subroutine of memory bank

Country Status (1)

Country Link
JP (1) JPH01216428A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5663657A (en) * 1979-10-30 1981-05-30 Fujitsu Ltd Memory switching system
JPS62297954A (en) * 1986-06-18 1987-12-25 Toshiba Corp Memory control system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5663657A (en) * 1979-10-30 1981-05-30 Fujitsu Ltd Memory switching system
JPS62297954A (en) * 1986-06-18 1987-12-25 Toshiba Corp Memory control system

Similar Documents

Publication Publication Date Title
US20020062352A1 (en) Multiprocessor system and control method thereof
JPH03268005A (en) Programmable controller
JPH01216428A (en) System for executing subroutine of memory bank
JPH02253440A (en) Time division multitask execution device
JPH01292432A (en) Subroutine execution system for memory bank
JP2004318403A (en) Electronic controller
JPH01216433A (en) Interruption control system
JP2522412B2 (en) Communication method between programmable controller and input / output device
JP3616649B2 (en) Method and apparatus for enabling address lines to access upper memory areas
JPH1055278A (en) Memory mixed microcomputer
JP3520966B2 (en) Information processing equipment
JP4037941B2 (en) Control device
JP2705955B2 (en) Parallel information processing device
JPH01297732A (en) Interruption control system
JPH02127746A (en) Calculating device
JPS63311436A (en) Program patch system
JPS5854422B2 (en) Control method for multiprocessing equipment
JPH03231343A (en) Memory space expansion system for microprocessor
JPH0261749A (en) Data transfer device
JPS6379162A (en) Control system for transferring processor data
JPS6036615B2 (en) Memory control method
JPH0477930A (en) Microcomputer
JPS63167953A (en) Multi-processor system
JPH0869444A (en) Multiprocessor system
JPH04148340A (en) Transaction executing system