JPS6023381B2 - Variable length segment control method - Google Patents

Variable length segment control method

Info

Publication number
JPS6023381B2
JPS6023381B2 JP55077372A JP7737280A JPS6023381B2 JP S6023381 B2 JPS6023381 B2 JP S6023381B2 JP 55077372 A JP55077372 A JP 55077372A JP 7737280 A JP7737280 A JP 7737280A JP S6023381 B2 JPS6023381 B2 JP S6023381B2
Authority
JP
Japan
Prior art keywords
segment
address
section
address space
storage means
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.)
Expired
Application number
JP55077372A
Other languages
Japanese (ja)
Other versions
JPS573159A (en
Inventor
和夫 田尻
鎮雄 塩川
好美 福村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP55077372A priority Critical patent/JPS6023381B2/en
Publication of JPS573159A publication Critical patent/JPS573159A/en
Publication of JPS6023381B2 publication Critical patent/JPS6023381B2/en
Expired legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Storage Device Security (AREA)

Description

【発明の詳細な説明】 本発明はベースアドレス方式を探る情報処理装置におけ
る可変長セグメント制御方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a variable length segment control method in an information processing apparatus that explores a base address method.

ベースアドレス方式を探る情報処理装置において、ベー
スアドレスとそれからのアドレス偏差を表わす成分(1
つまたは複数)とから実効アドレスを求める方式として
、次のような方式が知られている。
In an information processing device exploring a base address method, a component (1
The following method is known as a method for determining an effective address from (one or more).

{1’ 有効なアドレスビットの全ビットを算術的に加
算する方式。
{1' A method of adding all valid address bits arithmetic.

■ 実効アドレスの下位ビットはベースアドレスの下位
ビットとアドレス偏差成分の有効なビットとの算術的な
加算により求め、実効アドレスの上位ビットはベースア
ドレスの上位ビットをそのま)用いる方式。
■ A method in which the lower bits of the effective address are determined by arithmetic addition of the lower bits of the base address and the valid bits of the address deviation component, and the upper bits of the base address are used as is for the upper bits of the effective address.

(3’ ベースアドレスからのアドレス偏差成分の上限
値をベースアドレスと対にして持ち、アドレス偏差成分
がこの上限値を超えない場合に限りベースアドレスとア
ドレス偏差成分とを算術的に加算して実効アドレスを求
める方式。
(3' The upper limit value of the address deviation component from the base address is paired with the base address, and only when the address deviation component does not exceed this upper limit value, the base address and the address deviation component are added arithmetically and executed. A method to obtain an address.

{1}の方式では、アドレス空間の全域にわたってアド
レスの連続性が保証される一方、プログラムがアドレス
偏差成分の指定を誤って許容されないアドレス空間をア
ドレシングする可能性がある。
In the method {1}, while the continuity of addresses is guaranteed throughout the address space, there is a possibility that the program may mistakenly specify an address deviation component and address an address space that is not allowed.

これをページと呼ばれるセグメントより小さいサイズの
区間ごとに設けたアクセスキーを用いたメモリ保護機構
によって防止する場合には、正当なアクセスに対しては
アクセスを許容できなければならないため、アクセスキ
ーの管理が複雑になるかあるいはメモリ保護が不十分に
なるなどの欠点がある。■の方式では、上記の実効アド
レスの上位ビットを固定のま)でアドレッシング可能な
アドレス空間をセグメントと呼び、アドレス偏差成分を
誤って設定した場合でも、ベースアドレスが指すセグメ
ント以外のセグメントへのアドレシングを未然に防ぐ特
徴がある。通常、セグメントの大きさはページより大で
あり、上記の特徴とべ−ジ単位のアクセス制限とを用い
てアクセスキーの管理を複雑化することなく2重のメモ
リ保護が可能である。しかし、一方ではアドレスの連続
性もまたセグメント内でしか保証されず、さらにアドレ
ス空間内に異なる大きさのセグメントを設定できないた
め、小さいプログラムに対してはセグメントの使用効率
が悪く、セグメントの大きさを超える大きいプログラム
は実行が困難であるなどの欠点がある。また{3丁の方
式では、アドレス偏差成分の上限値を変えることによっ
て、{2}の方式におけるセグメントの大きさを可変に
した場合と同様の効果が得られるが、アドレス偏差成分
の上限値がベースアドレスと対になっているため、ベー
スアドレスの変更のたびにベースアドレスと該ベースア
ドレスを用いたアドレシングを許容するアドレスの上限
との差を求めて、アドレス偏差成分の上限値を更新しな
ければならない欠点がある。
If this is to be prevented by a memory protection mechanism that uses access keys set for each section of a size smaller than a segment called a page, access keys must be managed because legitimate accesses must be allowed. However, there are drawbacks such as increased complexity and insufficient memory protection. In method (2), the address space that can be addressed by keeping the upper bits of the effective address fixed is called a segment, and even if the address deviation component is set incorrectly, addressing a segment other than the segment pointed to by the base address is not possible. It has the characteristic of preventing Normally, the size of a segment is larger than a page, and by using the above characteristics and access restriction in units of pages, double memory protection is possible without complicating the management of access keys. However, on the other hand, address continuity is also guaranteed only within a segment, and furthermore, it is not possible to set segments of different sizes within the address space, so segments are not used efficiently for small programs, and the segment size Programs larger than In addition, in the {3-double method, by changing the upper limit value of the address deviation component, the same effect as when the segment size is made variable in the {2} method can be obtained, but if the upper limit value of the address deviation component is Since it is paired with the base address, each time the base address is changed, the difference between the base address and the upper limit of addresses that allow addressing using the base address must be calculated and the upper limit value of the address deviation component must be updated. There are certain drawbacks.

本発明の目的はプログラムに必要十分な大きさのアドレ
ス連続区間(セグメント)を保証すると共に、アドレス
偏差成分の謀設定に対するメモリ保護を強化する可変長
セグメント制御方式を提供することにある。
An object of the present invention is to provide a variable length segment control method that guarantees a continuous address section (segment) of sufficient size for a program and strengthens memory protection against deliberate setting of address deviation components.

しかして本発明は、アドレスの連続区間である任意の大
きさのセグメントを記憶してこれを更新可能にすると共
に、この記憶内容を用いてベースアドレスと実効アドレ
スとが同一のセグメント内であるかを検出することを特
徴とするものである。
Therefore, the present invention makes it possible to store and update a segment of any size that is a continuous section of addresses, and also uses this stored content to determine whether the base address and effective address are within the same segment. It is characterized by detecting.

第1図は本発明におけるアドレスの連続性を保証する区
間であるセグメントの概念図であって、1はアドレス空
間、2はセグメントである。
FIG. 1 is a conceptual diagram of a segment, which is an interval for ensuring continuity of addresses in the present invention, where 1 is an address space and 2 is a segment.

アドレス空間はプログラムの指定によって複数のセグメ
ントに分割される。各セグメントは1個以上のざらにづ
・ごし、構成単位3(以下セクションと称す)で構成さ
れる。セクションは全て同じ大きさであり、アドレス空
間全域にわたって通し番号がふられているものとする。
セグメントの大きさはセクションの大きさを単位として
プログラムで任意に設定でき、各セグメント内ではアド
レスの連続性を保証すると)もに、ベースアドレスと実
効アドレスとがセグメント境界をまたぐ(異なるセグメ
ントに属する)場合にはこれを検出し割り込み信号を発
生する。以下にその制御機構を示す。第2図は本発明の
一実施例を示す。4はセグメント指定情報を格納する記
憶機構であり、アドレス空間内の全セクション数に対応
した語数を持つ。
The address space is divided into multiple segments according to program specifications. Each segment is composed of one or more grains, structural units 3 (hereinafter referred to as sections). It is assumed that all sections have the same size and are serially numbered throughout the address space.
The size of a segment can be set arbitrarily by a program using the section size as a unit, and if the continuity of addresses is guaranteed within each segment, the base address and effective address may cross segment boundaries (belong to different segments). ), this is detected and an interrupt signal is generated. The control mechanism is shown below. FIG. 2 shows an embodiment of the invention. 4 is a storage mechanism for storing segment designation information, and has the number of words corresponding to the total number of sections in the address space.

プログラムによって該記憶機構4の内容を更新するため
の命令を発行した場合には、命令制御部5から信号線6
を介して送られてきたアドレスで選択される語に信号線
7を介して主記憶あるいは演算レジスタ8からのデータ
を書き込む。9はベースアドレスを保持するレジスタ、
10および11はアドレス偏差成分を保持するレジスタ
(2つの正の偏差成分を持つ例)であり、12は各レジ
スタ9,10,11の全ビットを算術的に加算して実効
アドレス13を得るための加算器である。
When a program issues a command to update the contents of the storage mechanism 4, the signal line 6 is sent from the command control unit 5.
Data from the main memory or arithmetic register 8 is written via the signal line 7 into the word selected by the address sent via the signal line 7. 9 is a register that holds the base address;
10 and 11 are registers that hold address deviation components (an example with two positive deviation components), and 12 is for obtaining the effective address 13 by arithmetically adding all bits of each register 9, 10, and 11. is an adder.

なおレジス夕9,10,11および12は本発明に特有
なものではない。いま、第3図に示すとおり、セクショ
ン番号n−3からnまでの4つのセクションを1つのセ
グメントとして使用する場合を例にとってベースアドレ
スと実効アドレスとがセグメント境界をまたぐ場合の検
出法を説明する。
Note that register numbers 9, 10, 11, and 12 are not unique to the present invention. Now, as shown in Figure 3, we will explain how to detect when the base address and effective address cross the segment boundary, taking as an example the case where four sections with section numbers n-3 to n are used as one segment. .

記憶機構4には、第3図のようにプ。グラムによってセ
クション番号をアドレスとする各語に該セクションが属
するセグメントの最終セクション番号が格納されている
ものとする。ベースアドレスの属するセグメントの最終
セクション番号は、ベースアドレスを保持するレジスタ
9のうちセクション番号を表わす部分14で記憶機構4
を索引することによって得られる。いま第3図の例にお
いてベースアドレスのセクション番号n−2であれば、
ベースアドレスの属するセグメントの最終セクション番
号nが記憶機構4から読み出され信号線15を介してレ
ジスター6に格納される。次に実効アドレス13のうち
セクション番号を表わす部分17が信号線18を介して
比較器19に送られる。比較器19は信号線20を介し
て得られるレジスタ16の内客、即ちベースアドレスの
属するセグメントの最終セクション番号と、信号線18
上の実効アドレスのセクション番号とを比較して、後者
が前者より大である場合には信号線21を介して割り込
み信号を送り出す。いま、第3図の例において、実効ア
ドレスのセクション番号がnの場合には、ベースアドレ
スが属するセグメントの最終セクション番号nより大で
ないため割り込み信号を発生しないが、実効アドレスの
セクション番号がn+1の場合には、ベースアドレスが
属するセグメントの最終セグメント番号nより大である
ため、ベースアドレスと実効アドレスがセグメント境界
をまたいでいることを検出して割り込み信号を発生する
。 ′なお、第3図は第2図の構成
と対応したセグメント指定情報の例であるが、記憶機構
4の各語に対応するセクションが属するセグメントの番
号(アドレス空間内のセグメントごとにふられた番号)
を格納しておき、ベースアドレスのセクション番号部1
4を用いて記憶機構4を索引することによって得たベー
スアドレスの属するセグメント番号と、実効アドレスの
セクション番号部17を用いて記憶機構4を再び索引し
て得た実効アドレスの属するセグメント番号とを比較し
て、両者が一致しない場合に割り込み信号を発生する、
アドレス偏差成分が負の場合でも対処可能な実施例とす
ることもできる。
The storage mechanism 4 has a program as shown in FIG. It is assumed that each word whose address is a section number stores the final section number of the segment to which the section belongs. The final section number of the segment to which the base address belongs is stored in the storage mechanism 4 in the section 14 representing the section number of the register 9 that holds the base address.
obtained by indexing. In the example of Figure 3, if the base address section number is n-2,
The final section number n of the segment to which the base address belongs is read from the storage mechanism 4 and stored in the register 6 via the signal line 15. Next, a portion 17 representing the section number of the effective address 13 is sent to a comparator 19 via a signal line 18. The comparator 19 compares the last section number of the segment to which the base address belongs, which is obtained from the register 16 via the signal line 20, and the signal line 18.
The above effective address is compared with the section number, and if the latter is larger than the former, an interrupt signal is sent out via the signal line 21. Now, in the example shown in Figure 3, if the section number of the effective address is n, no interrupt signal will be generated because it is not greater than the final section number n of the segment to which the base address belongs, but if the section number of the effective address is n+1. In this case, since the base address is greater than the final segment number n of the segment to which it belongs, it is detected that the base address and the effective address straddle the segment boundary, and an interrupt signal is generated. 'Although Figure 3 is an example of segment specification information corresponding to the configuration in Figure 2, the number of the segment to which the section corresponding to each word in the storage mechanism 4 belongs (number assigned for each segment in the address space) number)
Store the section number part 1 of the base address.
The segment number to which the base address belongs, obtained by indexing the storage mechanism 4 using 4, and the segment number to which the effective address belongs, obtained by indexing the storage mechanism 4 again using the section number part 17 of the effective address. Compare and generate an interrupt signal if the two do not match.
It is also possible to provide an embodiment that can handle the case where the address deviation component is negative.

また、記憶機構4は各セクションごとに対応する1ビッ
トを持ってセグメントの先頭のセクションに対応したビ
ットにセグメント境界表示ビットを立て)おき、ベース
アドレスのセクション番号がn、実効アドレスのセクシ
ョン番号がmのとき、n<mであればビット番号n+1
からビット番号mまでの各ビットが1でその他のビット
は0のビット列を、n>mであればビット番号m+1か
らビット番号nまでの各ビットが1でその他のビットは
0のビット列を、またn=mであれば全ビットが0のビ
ット列を作り、記憶機構4から読み出したビット列との
間で各ビットごとに論理積をとった後に全ビットにわた
って論理和をとった結果が1であるときに割り込み信号
を発生することにより記憶機構4の記憶容量を小さくし
、かつアドレス偏差成分が負の場合でも対処可能な実施
例についても容易に想像できる。以上説明したように、
本発明によれば、アドレスの連続性を保証するセグメン
トの大きさはあらかじめプログラムによって指定でき、
さらにセグメント境界をまたぐアドレシングを検出する
手段を有するため、プログラムが必要とするアドレス空
間の大き乳こあわせてセグメントの大きさを決めること
によってアドレス空間の有効利用がはかられ、また、セ
グメントの大きさは−旦プログラムで設定しておけば、
アドレシングのたびにプログラムがアドレス偏差成分の
大きさを意識する必要はなく、さらに、プログラムがア
ドレス偏差成分の設定を誤って許可されていないアドレ
ス空間をアドレシングするのを未然に防止することによ
ってメモリ保護の強化がはかれるなどの利点がある。
In addition, the storage mechanism 4 has one bit corresponding to each section, sets a segment boundary display bit in the bit corresponding to the first section of the segment, and sets the section number of the base address to n and the section number of the effective address to When m, if n<m, bit number n+1
A bit string in which each bit from bit number m to bit number m is 1 and all other bits are 0, and if n>m, a bit string in which each bit from bit number m+1 to bit number n is 1 and all other bits are 0, and If n=m, create a bit string in which all bits are 0, perform logical AND for each bit with the bit string read from storage mechanism 4, and then perform logical OR over all bits. When the result is 1. It is also easy to imagine an embodiment in which the storage capacity of the storage mechanism 4 is reduced by generating an interrupt signal at the same time, and it is also possible to cope with the case where the address deviation component is negative. As explained above,
According to the present invention, the size of a segment that guarantees address continuity can be specified in advance by a program.
Furthermore, since it has a means for detecting addressing that crosses segment boundaries, effective use of the address space can be achieved by determining the segment size based on the size of the address space required by the program. If you set it in the program,
The program does not need to be aware of the size of the address deviation component each time it performs addressing, and it also protects memory by preventing the program from accidentally setting the address deviation component and addressing an unauthorized address space. It has the advantage of being able to strengthen the

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

第1図は本発明におけるセグメントおよびセクションの
概念図、第2図は本発明の一実施例を示すブロック図、
第3図は第2図の実施例においてセグメントの指定を行
なう情報の例を示す図である。 4・・・・・・記憶機構、5・・・・・・命令制御部、
8・・…・主記憶あるいは演算レジスタ、9・・・・・
・ベースアドレス保持用レジスタ、10および11.・
・・・・アドレス偏差成分保持用レジスタ、12・・・
・・・加算器、13・・・・・・実効アドレス、19・
・・・・・比較器。 第1図第2図 第3図
FIG. 1 is a conceptual diagram of segments and sections in the present invention, and FIG. 2 is a block diagram showing an embodiment of the present invention.
FIG. 3 is a diagram showing an example of information for specifying segments in the embodiment of FIG. 2. 4...Storage mechanism, 5...Instruction control unit,
8... Main memory or calculation register, 9...
- Base address holding registers, 10 and 11.・
...Address deviation component holding register, 12...
... Adder, 13... Effective address, 19.
...Comparator. Figure 1 Figure 2 Figure 3

Claims (1)

【特許請求の範囲】 1 アドレス空間がプログラムの指定によつて可変な複
数のセグメントに分割され、さらに各セグメントは1個
あるいは複数個のセクシヨンで構成されており、ベース
アドレスと該ベースアドレスからの偏差成分とを用いて
前記アドレス空間上の実効アドレスを得る情報処理装置
において、各セクシヨン対応に、該当セクシヨンが属す
るセグメントの最終セクシヨン番号を記憶する記憶手段
と、前記ベースアドレスのセクシヨン番号部で前記記憶
手段を索引して該当セクシヨンの属するセグメントの最
終セクシヨン番号を読み出す手段と、該読み出された最
終セクシヨン番号と実効アドレスのセクシヨン番号部と
の大小関係を比較する比較手段とを設け、許容された可
変長のセグメント外のアドレス空間へのアドレツシング
を前以つて検出することを特徴とする可変長セグメント
制御方式。 2 アドレス空間がプログラムの指定によつて可変な複
数のセグメントに分割され、さらに各セグメントは1個
あるいは複数個のセクシヨンで構成されており、ベース
アドレスと該ベースアドレスからの偏差成分とを用いて
前記アドレス空間上の実効アドレスを得る情報処理装置
において、各セグメント対応に、該当セクシヨンが属す
るセグメント番号を記憶する記憶手段と、前記ベースア
ドレスのセクシヨン番号部で前記記憶手段を索引して該
当セクシヨンの属するセグメント番号を読み出す手段と
、前記実効アドレスのセクシヨン番号部で前記記憶手段
を索引して該当セクシヨンの属するセグメント番号を読
み出す手段と、前記読み出された両セグメント番号の一
致を比較する比較手段とを設け、許容された可変長のセ
グメント外のアドレス空間へのアドレツシングを前以つ
て検出することを特徴とする可変長セグメント制御方式
[Scope of Claims] 1. The address space is divided into a plurality of variable segments according to program specifications, and each segment is composed of one or more sections, and each segment has a base address and a base address. In the information processing apparatus for obtaining an effective address on the address space using a deviation component, the storage means stores, corresponding to each section, the last section number of the segment to which the corresponding section belongs; means for indexing the storage means and reading out the final section number of the segment to which the relevant section belongs; and comparison means for comparing the magnitude relationship between the read final section number and the section number part of the effective address. A variable-length segment control method characterized in that addressing to an address space outside a variable-length segment is detected in advance. 2. The address space is divided into a plurality of segments that are variable according to program specifications, and each segment is composed of one or more sections. The information processing apparatus for obtaining an effective address on the address space includes a storage means for storing a segment number to which a corresponding section belongs for each segment, and a storage means for indexing the storage means using the section number part of the base address to store the number of the corresponding section. means for reading out the segment number to which the section belongs; means for reading out the segment number to which the section belongs by indexing the storage means using the section number part of the effective address; and comparison means for comparing the read segment numbers to see if they match. 1. A variable length segment control method, wherein addressing to an address space outside a permitted variable length segment is detected in advance.
JP55077372A 1980-06-09 1980-06-09 Variable length segment control method Expired JPS6023381B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP55077372A JPS6023381B2 (en) 1980-06-09 1980-06-09 Variable length segment control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP55077372A JPS6023381B2 (en) 1980-06-09 1980-06-09 Variable length segment control method

Publications (2)

Publication Number Publication Date
JPS573159A JPS573159A (en) 1982-01-08
JPS6023381B2 true JPS6023381B2 (en) 1985-06-07

Family

ID=13632062

Family Applications (1)

Application Number Title Priority Date Filing Date
JP55077372A Expired JPS6023381B2 (en) 1980-06-09 1980-06-09 Variable length segment control method

Country Status (1)

Country Link
JP (1) JPS6023381B2 (en)

Also Published As

Publication number Publication date
JPS573159A (en) 1982-01-08

Similar Documents

Publication Publication Date Title
US6021476A (en) Data processing apparatus and method for controlling access to a memory having a plurality of memory locations for storing data values
US6381668B1 (en) Address mapping for system memory
GB1495332A (en) Memory having non-fixed relationships between addresses and storage locations
US7558940B2 (en) Virtual memory translator for real-time operating systems
JPS6023381B2 (en) Variable length segment control method
JPS5816263B2 (en) General information
JPS6220583B2 (en)
JP2005222519A (en) Access to bit value in data word stored in memory
US11853598B2 (en) Software memory tagging for heap overflow protection
JPS6035694B2 (en) Main memory protection method
JPS595496A (en) Memory protect system
JPH01166148A (en) Memory access device
JPS59139199A (en) Protecting method of storage
JPS62120543A (en) Switching system for memory bank
JP3147236B2 (en) Cache memory device
JPH0764858A (en) Cache memory
JPS6010669B2 (en) Storage device control method
JPS6124734B2 (en)
JPH0256038A (en) Access control system for memory
JPH06250921A (en) Access device
JPH06103162A (en) Ram address controller
JPS63206844A (en) System for storing key of information processor
JPH03211622A (en) Information processor
JPH02230324A (en) Microprogram controller
JPS5977694A (en) Information processor