JPH0315775B2 - - Google Patents

Info

Publication number
JPH0315775B2
JPH0315775B2 JP58049367A JP4936783A JPH0315775B2 JP H0315775 B2 JPH0315775 B2 JP H0315775B2 JP 58049367 A JP58049367 A JP 58049367A JP 4936783 A JP4936783 A JP 4936783A JP H0315775 B2 JPH0315775 B2 JP H0315775B2
Authority
JP
Japan
Prior art keywords
byte
bit
value
address
consecutive
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 - Lifetime
Application number
JP58049367A
Other languages
Japanese (ja)
Other versions
JPS59173865A (en
Inventor
Hiroshi Yoshida
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP58049367A priority Critical patent/JPS59173865A/en
Publication of JPS59173865A publication Critical patent/JPS59173865A/en
Publication of JPH0315775B2 publication Critical patent/JPH0315775B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【発明の詳細な説明】[Detailed description of the invention]

(a) 発明の技術分野 本発明は処理装置に接続される直接アクセス記
憶装置の格納状態、特に空きスペースを管理する
ための空きスペース検索方法に関する。 (b) 従来技術と問題点 処理装置に接続される直接アクセス記憶装置
(以後DASDと記入する)は種々の情報が格納さ
れ、しかも不必要であれば消去も行われている。
従つて、このDASD上の空きスペースを管理する
ことが必要である。 このため、DASD上の記憶領域を所定の大きさ
を単位とするブロツクに分割し、このブロツクご
とに1ビツトを対応させたビツトマツプを用い、
未使用のブロツクに対するビツトは‘0'、使用中
のブロツクに対するビツトは‘1'として、DASD
の使用状態を管理している。 従来このビツトマツプから連続する空きスペー
ス即ち‘0'の数を検出するのに、ビツトマツプか
ら1バイト単位でレジスタに順次入力し、これを
左シフトして、シフトアウトされる‘0'、‘1'を
計数することにより、連続した空きスペースを検
知するといつた方法が採用されている。 この従来の空きスペースの検索方法は、1バイ
トを検査するのに、シフト命令と比較命令をそれ
ぞれ8回必要とし、この二つの命令だけで16ステ
ツプを要する。従つて、ビツトマツプを全域にわ
たつて調べるには、命令のステツプ数は非常に大
きなものとなる。そのため、従来方法では、空き
スペースの管理は処理速度が遅いという問題があ
つた。 (c) 本発明の目的 本発明は上記従来の欠点に鑑み、高速に能率よ
く空きスペースの検索を行うことのできる、空き
スペース検索方法を提供することを目的とする。 (d) 発明の構成 本発明は、直接アクセス記憶装置(DASD)
と、その記憶領域の使用状態を示すビツトマツプ
を具備する処理装置において、1つのバイトを最
高位ビツトから見て最初に現れる‘0'の数と、そ
の‘0'のビツト列が最下位ビツトを含むか否か
を、ビツトパターン対応に示す第1の変換表と、
1バイトの最高位ビツトが‘0'の場合には、最高
位ビツトから連続する‘0'のビツト数を、最高位
ビツトが‘1'の場合にはその旨を識別しうる値
を、ビツトパターン対応に示す第2の変換表を設
ける。 但し、上記第2の変換表は、特殊な場合として
最高位ビツトから‘0'が8個連続する場合、即ち
全ビツトが‘0'の場合には、変換値を本来の‘8'
に変えて‘0'としておく。 また、最高位ビツトが‘1'の場合には、その旨
を識別できるように、例えば‘8'以上の値を対応
させておく。 空きスペースの検索に際しては、DASDの使用
状態を示すビツトマツプの所定のバイトを、ま
ず、そのビツトパターンに基づいて第1の変換表
を参照し、対応する変換値を読み出す。変換値が
“0”の場合には、次のバイトに対して同じ処理
を続行する。変換値が“0”と異なる値であれば
処理を停止し、その時のバイトのアドレスを‘0'
を含むバイト列の先頭アドレスとし、その時の変
換値からそのバイトの‘0'の個数と、その‘0'の
ビツト列がLSBを含むか否かを検出する。 LSBを含む場合には、引き続いて、上記先頭
アドレスの次のアドレスのバイトのビツトパター
ンに基づいて第2の変換表を参照し、対応する変
換値を読み出す。その変換値が“0”の場合には
次のアドレスのバイトについて同じ処理を続行
し、変換値が“0”と異なる値の場合には処理を
停止し、その時のバイトのアドレスを‘0'のビツ
ト列の末尾バイトのアドレスとし、その時の変換
値から‘0'を含む最終バイト中のMSBから連続
する‘0'の数を検出し、これらの値から連続する
‘0'の総数を求める。 (e) 本発明の実施例 以下本発明の実施例を図面によつて詳細に説明
する。 第1図は、本発明に係る空きスペース検索方法
の一実施例に用いた処理装置の構成を示すブロツ
ク図、第2図は上記一実施例で用いた第1および
第2の変換表の構成例を示す図、第3図は本実施
例の空きスペース検索方法を示すフローチヤート
である。 第1図において、1は主記憶装置、2は変換表
で、第1の変換表2−1と第2の変換表2−2を
有する。3は中央処理装置(CPU)、4は主記憶
制御部、5は命令制御部、6は演算処理部、6−
1はレジスタ、7は直接記憶装置(DASD)をそ
れぞれ示す。 本実施例は、DASDの使用状態を示すビツトマ
ツプを、第1の変換表2−1を参照して‘0'のビ
ツト列が始まる先頭バイトのアドレスと、そのバ
イト中の‘0'の個数を検出し、次に、第2の変換
表を参照して、‘0'のビツト列が終わる末尾バイ
トのアドレスと、そのバイト中の最高位ビツト
(MSB)から連続する‘0'の個数を検出し、これ
らの値から連続する‘0'の総数とその位置を知
り、空き領域を検索しようとするものである。 8ビツトからなるバイトのビツトパターンは、
256種類存在する。第2図a,bは、いずれもこ
の256種類のビツトパターンに対する変換値を示
す表であり、バイトの値を16進数で表した場合の
上位桁を縦軸に、下位桁を横軸にとつてある。 まず第1の変換表2−1を、第2図aにより説
明する。第1の変換表2−1は、1つのバイトを
最高位ビツトから見て最初に現れる‘0'の数を示
す。例えば、16進数の“CB”というバイトに対
するビツト列は、‘11001011'である。これには
ビツト‘0'が1個以上連続するビツト列は2つ存
在する。第1の変換表2−1は、この‘0'のビツ
ト列のうち、MSBから見て最初に出現するもの
の‘0'の個数を示す。 更に、このMSBから見て最初に出現する‘0'
のビツト列が、最下位ビツト(LSB)を含む場
合には、‘0'の個数を16倍した値を格納してお
き、LSBを含むことを容易に識別できるように
してある。例えば、“80”なるバイトのビツトパ
ターンは、‘10000000'であり、この‘0'の個数
は7個である。これを16進数表示すると“07”で
あるが、16倍した“70”という値を格納してあ
る。このような値にしたのは、1バイト中の‘0'
の個数として出現することはあり得ない値であ
り、また、識別が容易であり、しかも、この値を
4回右シフトすることにより、簡単に真の値を得
られることによる。従つて16倍する以外に、
MSBを‘1'にする等の方法を、LSBを含むこと
を示すために用いることができる。 上記‘0'のビツト列がLSBを含むビツトパター
ンは、全部で8種類のみであり、図に“N×16”
として示してある。 第2の変換表2−2の基本的な性格は、MSB
から連続する‘0'のビツト数を、ビツトパターン
対応に示す表である。但し、全ビツトが‘0'即ち
16進数の“00”は、本来は“8”であるが、これ
を“0”としてある点、および、MSBが‘1'即
ち“80”以上の値の場合は、本来の値は“0”で
あるが、これを“8”としてある。換言するな
ら、MSBが‘0'の場合には0〜7を、MSBが‘
1'の場合は8を割り付けたものである。 このように構成したのは、本実施例において上
記2つの変換表を用いておこなう処理が、検出し
た変換値が‘0'の場合には、引き続いて次のバイ
トに対して同じ処理を続行し、‘0'以外の値の場
合には、そのバイトに対する変化値とそのバイト
のアドレスを返して処理を停止するためである。
この点につていは後述する。 次にこのように構成した2つの変換表を用いた
本実施例の処理を、第2図a,bおよび第3図を
参照しながら説明する。 上記2つの変換表を参照して行う本実施例にお
ける変換処理に対する命令を、説明を簡単にする
ため、翻訳テスト命令と称することとする。 この翻訳テスト命令は、検査対象バイトのアド
レスと、変換表を指定して実行する。 従つて、DASDの空き領域を検索するには、ま
ず、空き領域を管理するためのビツトマツプの先
頭アドレスと、第1の変換表2−1を指定して、
上記翻訳テスト命令を実行する。例えば、下記第
1表に示すようなビツトマツプがあるとする。
(a) Technical Field of the Invention The present invention relates to a free space search method for managing the storage status of a direct access storage device connected to a processing device, particularly free space. (b) Prior Art and Problems Direct access storage devices (hereinafter referred to as DASD) connected to processing units store a variety of information, and are also erased if unnecessary.
Therefore, it is necessary to manage the free space on this DASD. For this reason, the storage area on the DASD is divided into blocks of a predetermined size, and a bitmap is used in which each block corresponds to one bit.
The bits for unused blocks are '0' and the bits for used blocks are '1', and the DASD
The usage status is managed. Conventionally, in order to detect the number of consecutive empty spaces, ie, '0's, from this bit map, one byte is sequentially input from the bit map into a register, then shifted to the left, and the '0's and '1's are shifted out. A method has been adopted in which continuous free space is detected by counting the number of spaces. This conventional method of searching for free space requires eight shift instructions and eight compare instructions to examine one byte, and these two instructions alone require 16 steps. Therefore, in order to examine the entire bit map, the number of instruction steps becomes extremely large. Therefore, in the conventional method, there was a problem in that the processing speed of free space management was slow. (c) Purpose of the Present Invention In view of the above-mentioned drawbacks of the conventional art, an object of the present invention is to provide a method for searching for free space, which can search for free space quickly and efficiently. (d) Structure of the invention The present invention is directed to a direct access storage device (DASD).
In a processing device equipped with a bit map that shows the usage status of the storage area, the number of '0's that appear first when looking at one byte from the highest bit, and the bit string of '0's starting from the least significant bit. a first conversion table indicating whether or not it is included in a bit pattern correspondence;
If the highest bit of a byte is '0', the number of consecutive '0's starting from the highest bit is recorded, and if the highest bit is '1', the value that can be used to identify that fact is written as a bit. A second conversion table is provided corresponding to the pattern. However, in the second conversion table above, in a special case where there are eight consecutive '0's starting from the highest bit, that is, when all bits are '0', the converted value is changed to the original '8'.
Change it to '0'. Further, when the highest bit is '1', a value of '8' or higher, for example, is associated with it so that this can be identified. When searching for free space, first, the first conversion table is referred to based on the bit pattern of a predetermined byte of a bit map indicating the usage status of the DASD, and the corresponding conversion value is read out. If the converted value is "0", the same process continues for the next byte. If the converted value is different from "0", processing will be stopped and the address of the byte at that time will be set to '0'.
The number of '0's in that byte and whether or not the '0' bit string includes the LSB are detected from the converted value at that time. If the LSB is included, the second conversion table is subsequently referred to based on the bit pattern of the byte of the address next to the first address, and the corresponding conversion value is read out. If the converted value is "0", the same process continues for the byte at the next address, and if the converted value is different from "0", the process is stopped and the address of the current byte is set to '0'. As the address of the last byte of the bit string of . (e) Examples of the present invention Examples of the present invention will be described in detail below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of a processing device used in an embodiment of the free space search method according to the present invention, and FIG. 2 is a diagram showing the configuration of the first and second conversion tables used in the above embodiment. An example diagram, FIG. 3, is a flowchart showing the empty space search method of this embodiment. In FIG. 1, 1 is a main storage device, and 2 is a conversion table, which includes a first conversion table 2-1 and a second conversion table 2-2. 3 is a central processing unit (CPU), 4 is a main memory control unit, 5 is an instruction control unit, 6 is an arithmetic processing unit, 6-
1 indicates a register, and 7 indicates a direct storage device (DASD). In this embodiment, a bit map indicating the usage status of the DASD is created by referring to the first conversion table 2-1 to determine the address of the first byte where the bit string of '0' starts and the number of '0' in that byte. Then, by referring to the second conversion table, find the address of the last byte where the '0' bit string ends and the number of consecutive '0's starting from the most significant bit (MSB) in that byte. Then, from these values, the total number of consecutive '0's and their positions are known, and an attempt is made to search for free space. The bit pattern of a byte consisting of 8 bits is
There are 256 types. Figures 2a and b are tables showing conversion values for these 256 types of bit patterns, with the upper digits of the byte value expressed in hexadecimal notation on the vertical axis and the lower digits on the horizontal axis. It is attached. First, the first conversion table 2-1 will be explained with reference to FIG. 2a. The first conversion table 2-1 shows the number of '0's that appear first when viewing one byte from the highest bit. For example, the bit string for the hexadecimal byte "CB" is '11001011'. There are two bit strings with one or more consecutive bits of '0'. The first conversion table 2-1 shows the number of '0's appearing first from the MSB in this '0' bit string. Furthermore, the first '0' appearing from this MSB
When the bit string contains the least significant bit (LSB), a value obtained by multiplying the number of '0's by 16 is stored so that it can be easily identified that the bit string contains the LSB. For example, the bit pattern of the byte "80" is '10000000', and the number of '0's is seven. When expressed in hexadecimal, this is "07", but the value multiplied by 16 is "70". This value was created by using '0' in 1 byte.
This is because it is an impossible value to appear as the number of , and it is easy to identify.Moreover, by right-shifting this value four times, the true value can be easily obtained. Therefore, in addition to multiplying by 16,
Methods such as setting the MSB to '1' can be used to indicate that the LSB is included. There are only eight types of bit patterns in which the above '0' bit string includes the LSB, and the figure shows "N x 16".
It is shown as. The basic characteristics of the second conversion table 2-2 are MSB
This is a table showing the number of consecutive '0' bits corresponding to bit patterns. However, all bits are '0', i.e.
The hexadecimal number "00" is originally "8", but it is treated as "0", and if the MSB is '1', that is, "80" or more, the original value is "0". ”, but this is set as “8”. In other words, if MSB is '0', 0 to 7, MSB is '
In the case of 1', 8 is assigned. The reason for this configuration is that in this embodiment, the processing performed using the above two conversion tables continues the same processing for the next byte when the detected conversion value is '0'. , if the value is other than '0', the change value for that byte and the address of that byte are returned and processing is stopped.
This point will be discussed later. Next, the processing of this embodiment using the two conversion tables configured as described above will be explained with reference to FIGS. 2a and 2b and FIG. 3. To simplify the explanation, the command for the conversion process in this embodiment, which is performed with reference to the above two conversion tables, will be referred to as a translation test command. This translation test instruction is executed by specifying the address of the byte to be tested and the conversion table. Therefore, to search for free space on a DASD, first specify the start address of the bit map for managing free space and the first conversion table 2-1, and then
Execute the above translation test command. For example, suppose there is a bitmap as shown in Table 1 below.

【表】 このビツトマツプでは、バイト0にはMSB側
に3個の連続した‘0'即ち空きが存在し、バイト
1からバイト3間にかけて14個の‘0'即ち空きが
連続する。 このようなビツトマツプに対して、第1の変換
表を指定して翻訳テスト命令を実行すると、まず
ビツトマツプの先頭バイトに、バイトポインタが
設定される〔第3図(1)参照〕。 上記第1表の先頭バイトの‘11001011'は16進
数にて示すとCBであり、第2図aに示す第1の
変換表を参照して、変換値として“2”が得られ
る〔第3図(2)参照〕。 このように変換値が“0”以外の値であつた場
合には、検査対象バイトが‘0'を含むことを示
す。つまり、ビツトマツプにおいて空き領域を示
すバイトが検出されたこととなる。 もし、変換値が“0”の場合には、そのバイト
には‘0'即ち空き領域が存在しないので、次のバ
イトに対して、翻訳テスト命令を続行する。そし
て、256バイト全部が“0”であれば〔第3図(3)
参照〕、マツプポインタを256進めて〔第3図(4)参
照〕、次の256バイトに対して翻訳テスト命令を続
行する。 上記の如く変換値が“2”であれば、翻訳テス
ト命令を停止し、このバイト中の‘0'のビツト列
が、次のバイトに連続しているか否かを、変換値
が16より大きいか否かで判定する〔第3図(5)参
照〕。 この例の場合には、変換値が“2”であつて、
16より小さいので、この“2”を第1図に示すレ
ジスタ6−1に入力し、この値を‘0'が連続する
値、つまり空き領域の大きさとして検出〔第3図
(6)参照〕するとともに、このバイトのアドレスを
検出して、処理を終了する。 上記レジスタ6−1の値、即ち“2”は、当該
バイトの一番左側に2個の空き領域のあり、しか
もこの‘0'のビツト列はLSBを含まないこと、つ
まり、次のバイトに連続していないことを示す。 もし変換値が16より大きいもの、例えば
11111000なるバイト〔16進数で“F8”〕の場合に
は、変換値は第2図aより“3×16”である。こ
の場合には、変換値を16にて割り、その値の
“3”を“0”の個数として、レジスタ6−1に
入力する。〔第3図(7)参照〕。即ち“×16”として
示す値は、上記した如くこのバイトの‘0'のビツ
ト列がLSBを含むこと、即ち次のバイトに‘0'の
ビツト列が連続していることを示す。従つて、こ
の場合には次のバイトを調査することが必要であ
り、マツプポインタを1バイト進めて〔第3図(8)
参照〕、第2の変換表2−2を用いて翻訳テスト
を続行する。 例えば、前述した“F8”に16進数“1B”〔ビツ
ト列は‘00011011'〕が続くとすると、第2図b
より“3”が求まる。 変換値は“0”でないので、翻訳テスト処理は
ここで停止し〔第3図(10)参照〕、変換値が“8”
か否か、つまり、MSBから連続する‘0'のビツ
ト列があるか否かを検査し〔第3図(11)参照〕、
“8”ではないので、MSBから連続する‘0'のビ
ツト列が存在し、その個数は3個である。 そこで、先にレジスタ6−1に格納した“3”
と、第2の変換表から得られた“3”とを加算し
て、空きビツト数として“6”が求まる〔第3図
(13)参照〕。なお、この場合、第2の変換表を用
いた翻訳テスト処理で、変換終了バイトと変換開
始バイトは同一であるので、この2つのバイトの
アドレスの差は“0”であり、第3図(13)の式
の第2項は“0”となる。 上記第3図(11)の検査で、変換値が“8”の場合
には、MSBから連続する‘0'のビツト列が存在
しないことを示すので、変換値を“0”に置き換
えて〔第3図(12)参照〕、第3図(13)の処理をお
こなう。 第3図(10)の検査で、得られた変換値が“0”で
あれば、このバイトは全ビツト‘0'であることを
示し、なお次のバイトに‘0'が続く可能性がある
ので、次のバイトに対して翻訳テスト処理を続行
する。そして、256バイト全部が“0”に変換さ
れた場合には、レジスタ6−1の値に256バイト
分の‘0'の個数、即ち、256×8を加算し、これ
を改めてレジスタ6−2に格納しておき〔第3図
(14)参照〕、マツプポインタを256バイト進めて、
第2の変換表を参照した翻訳テストを、次の256
バイトに対して続行する〔第3図(9)参照〕。 以上述べた如く、本実施例では第1の変換表を
用いて翻訳テスト命令を実行し、‘0'のビツト列
が始まる先頭バイトの位置と、その‘0'の個数を
見出し、この‘0'のビツト列がLSBを含む場合に
は、次のバイトから第2の変換表を用いて再び翻
訳テスト命令を実行し、‘0'のビツト列が終了す
るバイトを検出して、そのアドレスとそのバイト
のMSBから連続する‘0'のビツト数を求め、こ
れらの値から、ビツトマツプにおける‘0'のビツ
ト列の位置と、連続する‘0'のビツト数を検出す
る。 なお、この翻訳テスト命令は、コード変換のた
めに一般的に装備されている命令である。例えば
文字コードとして、ASCIIコードとEBCDICの2
つが主として使用されており、これを相互に変換
する必要がしばしば出現する。翻訳テスト命令は
このような場合に使用されるもので、予め準備さ
れた変換表と変換対象領域の先頭アドレスを指定
して実行することにより、1バイトを1ステツプ
で変換値を検出する事ができる。更にこの命令
は、前述したように、変換値が“0”の場合には
引き続いて次のバイトを処理し、変換値が“0”
以外の場合に、そのバイトのアドレスと変換値を
レジスタに格納して、処理を停止する。 本発明は翻訳テスト命令の上記性質を利用した
ものであつて、第1の変換表は、ビツトパターン
対応に、中に含まれる‘0'の個数を示すようにし
たことにより、‘0'を含むバイトに遭遇すると、
処理を停止して、そのバイト中の‘0'の個数とア
ドレスを返す。従つて、‘0'を含むバイトを1命
令で検知することができる。 第2の変換表は、全ビツトが‘0'の場合には変
換値を“0”とし、それ以外を“0”以外とした
ことにより、この変換表を参照して翻訳テストを
実行した場合に、‘1'を含むバイトを検出すると
処理を停止する。従つて、‘0'のビツト列が終了
するバイトを1命令で検知することができる。全
ビツトが‘0'のときの変換値を“8”の変わりに
“0”としたのは、この場合には‘0'のビツト列
がなお次のバイトに連続する可能性があるので、
処理を続行させるためである。 更に、この変換表において、変換値が“1”な
いし“7”の場合は、MSBから連続して‘0'が
存在し、且つ、そのバイトで‘0'のビツト列が終
了することを示す。また、MSBが‘1'の場合に
は、‘0'を含む場合には出現しない値であつて、
処理を停止できる値とするため、“8”以上の値
としたものである。 このようにしたことにより、従来は1バイトの
値を検出するため、前述したようにシフト命令と
比較命令だけで16ステツプを要したものを、本発
明では2種類の変換表を用いることにより、翻訳
テスト命令を1ステツプで可能となり、この翻訳
テスト命令を利用して、第3図により説明した手
順で高速且つ容易に空き領域を検出できる。 (f) 発明の効果 以上、詳細に説明したように、本発明の空きス
ペース検索方法は、2種類の変換表を用いて高速
に空きスペースの検索が行われ、DASDの記憶領
域を管理するのに利点の多いものである。
[Table] In this bitmap, byte 0 has three consecutive '0's, or empty spaces, on the MSB side, and 14 consecutive '0's, or empty spaces, from byte 1 to byte 3. When a translation test instruction is executed for such a bitmap by specifying the first conversion table, a byte pointer is first set at the first byte of the bitmap [see FIG. 3(1)]. The first byte '11001011' in Table 1 above is CB in hexadecimal, and by referring to the first conversion table shown in Figure 2 a, the converted value is ``2''. See Figure (2)]. In this way, when the converted value is a value other than "0", it indicates that the byte to be inspected contains '0'. In other words, a byte indicating a free area has been detected in the bitmap. If the conversion value is "0", that byte is "0", that is, there is no free area, so the translation test instruction is continued for the next byte. If all 256 bytes are “0” [Figure 3 (3)
], advances the map pointer by 256 [see FIG. 3 (4)], and continues the translation test instruction for the next 256 bytes. If the conversion value is "2" as above, the translation test instruction is stopped and the translation test instruction is checked to see if the '0' bit string in this byte is continuous in the next byte. The judgment is made based on whether or not [see Figure 3 (5)]. In this example, the conversion value is “2” and
Since it is smaller than 16, this "2" is input to the register 6-1 shown in Figure 1, and this value is detected as a value with consecutive '0's, that is, the size of the free space [Figure 3]
(6)], detects the address of this byte, and terminates the process. The value of register 6-1 above, ie, "2", indicates that there are two free areas on the leftmost side of the byte, and that this bit string of '0' does not include the LSB. Indicates that they are not consecutive. If the conversion value is greater than 16, e.g.
In the case of a byte of 11111000 ["F8" in hexadecimal], the converted value is "3×16" from FIG. 2a. In this case, the converted value is divided by 16, and the resulting value "3" is input to the register 6-1 as the number of "0"s. [See Figure 3 (7)]. That is, the value shown as "x16" indicates that the '0' bit string of this byte includes the LSB as described above, that is, the '0' bit string continues in the next byte. Therefore, in this case, it is necessary to examine the next byte, and advance the map pointer by one byte [Figure 3 (8)
], continue the translation test using the second conversion table 2-2. For example, if the aforementioned "F8" is followed by the hexadecimal number "1B" [bit string is '00011011'], Figure 2b
"3" can be found. Since the converted value is not "0", the translation test process stops here [see Figure 3 (10)], and the converted value is "8".
In other words, whether there is a continuous '0' bit string starting from the MSB [see Figure 3 (11)],
Since it is not "8", there is a string of consecutive '0' bits starting from the MSB, and the number of bits is three. Therefore, “3” previously stored in register 6-1
and "3" obtained from the second conversion table to obtain "6" as the number of free bits [see FIG. 3 (13)]. In this case, in the translation test process using the second conversion table, the conversion end byte and conversion start byte are the same, so the difference between the addresses of these two bytes is "0", and as shown in Figure 3 ( The second term in equation 13) is “0”. In the test shown in Figure 3 (11) above, if the converted value is "8", this indicates that there is no consecutive '0' bit string starting from the MSB, so the converted value is replaced with '0'. Refer to FIG. 3 (12)] and perform the processing shown in FIG. 3 (13). If the obtained converted value is "0" in the test shown in Figure 3 (10), this means that all bits of this byte are '0', and there is a possibility that '0' continues in the next byte. Therefore, the translation test process continues for the next byte. When all 256 bytes are converted to "0", the number of '0's for 256 bytes, that is, 256 x 8, is added to the value of register 6-1, and this is converted to register 6-1. [See Figure 3 (14)], advance the map pointer by 256 bytes, and
The following 256 translation tests refer to the second conversion table.
Continue with the bite [see Figure 3 (9)]. As described above, in this embodiment, the first conversion table is used to execute the translation test instruction, find the position of the first byte where the '0' bit string starts and the number of '0's, and If the bit string of '0' contains the LSB, execute the translation test instruction again using the second conversion table from the next byte, detect the byte where the bit string of '0' ends, and use that address and The number of consecutive '0' bits is determined from the MSB of that byte, and from these values, the position of the '0' bit string in the bit map and the number of consecutive '0' bits are detected. Note that this translation test instruction is an instruction generally provided for code conversion. For example, there are two character codes: ASCII code and EBCDIC.
are mainly used, and there is often a need to convert between them. The translation test command is used in such cases, and by specifying a pre-prepared conversion table and the start address of the area to be converted, it is possible to detect the converted value in one byte in one step. can. Furthermore, as mentioned above, if the converted value is "0", this instruction will continue to process the next byte, and if the converted value is "0"
Otherwise, store the address and conversion value of that byte in a register and stop processing. The present invention utilizes the above-mentioned properties of the translation test command, and the first conversion table is designed to indicate the number of '0's included in the bit pattern corresponding to the '0'. When you encounter a byte containing
Stops processing and returns the number of '0's in that byte and the address. Therefore, bytes including '0' can be detected with one instruction. In the second conversion table, when all bits are '0', the conversion value is set to '0', and otherwise it is set to other than '0', so when a translation test is executed with reference to this conversion table, When a byte containing '1' is detected, processing stops. Therefore, the byte where the '0' bit string ends can be detected with one instruction. The reason why we set the conversion value when all bits are '0' as '0' instead of '8' is because in this case there is a possibility that the '0' bit string will continue into the next byte.
This is to continue processing. Furthermore, in this conversion table, if the conversion value is "1" to "7", it indicates that there are consecutive '0's starting from the MSB and that the '0' bit string ends at that byte. . Also, if the MSB is '1', it is a value that does not appear if it contains '0',
The value is set to "8" or more in order to make it possible to stop the process. By doing this, in order to detect a 1-byte value, conventionally it required 16 steps with just the shift instruction and the comparison instruction as mentioned above, but with the present invention, by using two types of conversion tables, A translation test command can be executed in one step, and by using this translation test command, a free area can be detected quickly and easily using the procedure explained with reference to FIG. (f) Effects of the Invention As explained above in detail, the free space search method of the present invention uses two types of conversion tables to search for free space at high speed, and is effective in managing the storage area of DASD. It has many advantages.

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

第1図は本発明の空きスペース検索方法の一実
施例に用いたシステム構成を示すブロツク図、第
2図は上記一実施例の第1および第2の変換表の
構成を示す図、第3図は上記一実施例の空きスペ
ース検索方法のフローチヤートである。 図において、2は変換表、2−1,2−2は第
1および第2の変換表、3は中央処理装置、6−
1はレジスタ、7はDASDをそれぞれ示す。
FIG. 1 is a block diagram showing the system configuration used in an embodiment of the free space search method of the present invention, FIG. 2 is a diagram showing the structure of the first and second conversion tables of the above embodiment, and FIG. The figure is a flowchart of the empty space search method according to the above embodiment. In the figure, 2 is a conversion table, 2-1 and 2-2 are first and second conversion tables, 3 is a central processing unit, and 6-
1 indicates a register, and 7 indicates a DASD.

Claims (1)

【特許請求の範囲】 1 直接アクセス記憶装置と該直接アクセス記憶
装置の記憶領域使用状況を記憶領域対応に‘0'ま
たは‘1'のビツト値で示すビツトマツプを具備す
る処理装置において、前記ビツトマツプから前記
直接アクセス記憶装置の空きスペースを検索する
方法であつて、 8ビツトからなるビツト列を最高位ビツト側か
ら見たとき、最初に現れる‘0'が1個以上の連続
したビツト列の‘0'の数と、その‘0'のビツト列
が最下位ビツトを含むか否かを、ビツトパターン
対応に示す第1の変換表と、 前記ビツト列の最高位ビツトが‘0'の場合に
は、最高位ビツトから連続する‘0'の数が8個の
ときは“0”を、1ないし7個のときは最高位ビ
ツトから連続する‘0'の数を、また、最高位ビツ
トが‘1'の場合にはその旨を、ビツトパターン対
応に示す第2の変換表を設け、 前記ビツトマツプの指定したアドレスのバイト
のビツトパターンに基づいて前記第1の変換表か
ら対応する値を読みだし、読み出した値が“0”
の場合には次アドレスのバイトについて該処理を
繰り返し、読み出した値が“0”以外の場合には
処理を停止し、当該バイトのアドレスを‘0'を含
むバイト列の先頭アドレスとして記憶するととも
に、得られた変換値からそのバイト中の‘0'のビ
ツト列が最下位ビツトを含むか否かを知り、 最下位ビツトを含まない場合には、その変換値
を連続する‘0'の個数として検出し、 最下位ビツトを含む場合には、前記先頭アドレ
スの次位のアドレスのバイトのビツトパターンに
基づいて前記第2の変換表から対応する値を読み
だし、読み出した値が“0”の場合には、次のア
ドレスのバイトについて該処理を繰り返し、読み
出した値が“0”と異なる場合には処理を停止し
て、その時の検査対象バイトのアドレスを‘0'を
含むバイト列の最終アドレスとして記憶するとと
もに、該バイトに対する変換値から該バイト中の
‘0'の個数を知り、 これら先頭アドレスおよび最終アドレスのバイ
ト中の‘0'の個数と、両アドレスの差に基づい
て、連続する‘0'の個数を求め、 得られた結果から空き領域の大きさおよび該空
き領域の位置を知ることを特徴とする空きスペー
ス検索方法。
[Scope of Claims] 1. In a processing device equipped with a direct access storage device and a bitmap that indicates the storage area usage status of the direct access storage device as a bit value of '0' or '1' corresponding to the storage area, A method of searching for free space in a storage device, in which the number of consecutive '0's in which the first '0' appearing is one or more when a bit string consisting of 8 bits is viewed from the highest bit side. and a first conversion table that indicates whether or not the bit string of '0' includes the least significant bit, corresponding to the bit pattern; When the number of consecutive '0's from the bit is 8, it is "0", and when there are 1 to 7, it is the number of consecutive '0's from the highest bit, and when the highest bit is '1'. In this case, a second conversion table is provided to indicate this in correspondence with the bit pattern, and the corresponding value is read out from the first conversion table based on the bit pattern of the byte at the specified address of the bit map. Value is “0”
In this case, the process is repeated for the byte at the next address, and if the read value is other than "0", the process is stopped, and the address of the byte is stored as the first address of the byte string containing '0'. , find out from the obtained converted value whether the '0' bit string in that byte includes the least significant bit, and if it does not include the least significant bit, calculate the converted value by calculating the number of consecutive '0's. and if the least significant bit is included, the corresponding value is read from the second conversion table based on the bit pattern of the byte of the address next to the first address, and the read value is "0". In this case, the process is repeated for the byte at the next address, and if the read value is different from "0", the process is stopped and the address of the byte to be inspected at that time is set to the byte string containing '0'. While storing it as the final address, find out the number of '0's in the byte from the converted value for the byte, and based on the number of '0's in the bytes of these starting and final addresses and the difference between the two addresses, A free space search method characterized by: calculating the number of consecutive '0's, and determining the size of the free space and the position of the free space from the obtained result.
JP58049367A 1983-03-23 1983-03-23 Idle space retrieving method Granted JPS59173865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58049367A JPS59173865A (en) 1983-03-23 1983-03-23 Idle space retrieving method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58049367A JPS59173865A (en) 1983-03-23 1983-03-23 Idle space retrieving method

Publications (2)

Publication Number Publication Date
JPS59173865A JPS59173865A (en) 1984-10-02
JPH0315775B2 true JPH0315775B2 (en) 1991-03-01

Family

ID=12829044

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58049367A Granted JPS59173865A (en) 1983-03-23 1983-03-23 Idle space retrieving method

Country Status (1)

Country Link
JP (1) JPS59173865A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009144867A1 (en) 2008-05-26 2009-12-03 日本板硝子株式会社 Ultraviolet line illuminating apparatus, contacting image sensor, image reading apparatus, and reduced optical system image reading apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009144867A1 (en) 2008-05-26 2009-12-03 日本板硝子株式会社 Ultraviolet line illuminating apparatus, contacting image sensor, image reading apparatus, and reduced optical system image reading apparatus

Also Published As

Publication number Publication date
JPS59173865A (en) 1984-10-02

Similar Documents

Publication Publication Date Title
US4975872A (en) Dual port memory device with tag bit marking
KR100764260B1 (en) Variable-instruction-length processing
JPH0315775B2 (en)
JPH05134909A (en) Idle space retrieving method
JPS6044675B2 (en) Musical sound data processing device
JPS59101100A (en) Data comparing system
JPS6035694B2 (en) Main memory protection method
JPH06124238A (en) Method and device for selecting reloading object entry
JPH01175651A (en) Address converting system
JPH01166148A (en) Memory access device
JP2590866B2 (en) Data retrieval device
JPS6242249A (en) Test system for address converter
JPH03290741A (en) Error logging method
JPH10240627A (en) Sector management method and device
JPS63282527A (en) Addressing circuit for information processor
JPH02205937A (en) Information processing system
JPH01228037A (en) Address converter
JPS62284443A (en) Blank area retrieving and controlling system
JPH09319649A (en) Device and method for discriminating address
JPH03263142A (en) Memory managing method
JPS63217446A (en) Buffer control system
JPH02267646A (en) Disk cache device
JPS6269332A (en) Storing system for history information
JPS63249220A (en) Disk file managing method
JPH0546666A (en) Information retrieving device