JPS63173124A - Data editing method - Google Patents

Data editing method

Info

Publication number
JPS63173124A
JPS63173124A JP523787A JP523787A JPS63173124A JP S63173124 A JPS63173124 A JP S63173124A JP 523787 A JP523787 A JP 523787A JP 523787 A JP523787 A JP 523787A JP S63173124 A JPS63173124 A JP S63173124A
Authority
JP
Japan
Prior art keywords
data
memory
register
sort
sort memory
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
JP523787A
Other languages
Japanese (ja)
Inventor
Hiromi Ishizaki
寛美 石崎
Masayuki Ishigami
正之 石上
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.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP523787A priority Critical patent/JPS63173124A/en
Publication of JPS63173124A publication Critical patent/JPS63173124A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

PURPOSE:To perform the edit of a data at high speed, by storing a size read out with a code from a targeted data memory in a sort memory as an address. CONSTITUTION:A code data and the size are read out from the targeted data memory 2 via a CPU1. The code data is stored in a corresponding position in the sort memory 3 setting the size as the address. The data after completing storage is read out in order from the memory 3, and is outputted as an editing data, and no size comparing processing for individual data is required, thereby, the edit of the data can be performed at high speed.

Description

【発明の詳細な説明】 〔技術分野〕 本発明は、データの編集方法に関し、より詳細には、複
数のデータを大きさ順に並べ換えるデータの編集方法に
関する。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field] The present invention relates to a data editing method, and more particularly to a data editing method for rearranging a plurality of data in order of size.

〔従来技術〕[Prior art]

従来、複数のデータを大きさ順に並べ換えるデータの編
集方法として、バブルソート、クイックソートなどの方
法が知られている。
Conventionally, methods such as bubble sort and quick sort are known as data editing methods for rearranging a plurality of data in order of size.

第9図はバブルソートによるデータの編集方法を示す図
である。
FIG. 9 is a diagram showing a data editing method using bubble sort.

バブルソートによるli集集流法はデータの値を互いに
比べて並べ換えを行なう、第9図には、大きい方から順
々に並んでいる3つのデータを小さい方から順々に並べ
換えるtIA集方決方法されている。
The li collection method using bubble sort sorts data values by comparing them with each other. Figure 9 shows the tIA collection method, which sorts three pieces of data in order from the largest to the smallest. The method has been determined.

第9図(a)では先づ、データ“18″とデータ“11
”とを比較する。その結果データ“18”はデータ“1
1”と比べて大きいので、データ“18”とデータ“1
1”とを第9図(b)のように並び換える。次いで第9
図(b)において、データ“18”とデータ“9”とを
比較する。その結果、データ“18′の方が大きいので
、データ゛18”とデータ“9”とを第9図(C)に示
すように並び換える0次いで第9図(C)において、デ
ータ“11”とデータ“9”とを比較する。その結果、
データ“11″の方が大きいので、データ“11”とデ
ータ“9”とを第9図(d)に示すように並び換える。
In FIG. 9(a), data “18” and data “11” are shown first.
”.As a result, data “18” is data “1”.
1”, so the data “18” and the data “1”
1” as shown in FIG. 9(b). Then,
In Figure (b), data "18" and data "9" are compared. As a result, data "18'" is larger, so data "18" and data "9" are rearranged as shown in FIG. 9(C). Then, in FIG. 9(C), data "11" and Compare with data “9”. the result,
Since data "11" is larger, data "11" and data "9" are rearranged as shown in FIG. 9(d).

この結果、データ“18″。As a result, the data is "18".

“11”、“9”は小さい方から順々に並び換えられた
“11” and “9” were rearranged in order from smallest to largest.

またクイックソートによる編集方法では、N個のデータ
A〔1〕乃至A [N]を、ある値Cと比較して、これ
らのデータを値Cよりも大きいデータと値Cよりも小さ
いデータとの2つの集合に区分する。さらに、2つの集
合のそれぞれにおいて値E、Fを設定し、同様にして値
E、Fよりも大きいデータと小さいデータとに区分し、
このようにして順次に細区分を施して、データを並べ換
えるようになっている。
In addition, in the editing method using quick sort, N pieces of data A[1] to A[N] are compared with a certain value C, and these data are divided into data larger than value C and data smaller than value C. Divide into two sets. Furthermore, values E and F are set in each of the two sets, and data is similarly divided into data larger and smaller than the values E and F,
In this way, the data is sequentially subdivided and rearranged.

クイックソートによるデータの編集方法は、N個のデー
タをNj!ogNに比例する速度で並び換えることがで
きるのでバブルソートによるwAt方法に比べては高速
にデータをwA集することができる。
How to edit data using quick sort is to edit N pieces of data into Nj! Since data can be sorted at a speed proportional to ogN, data can be collected at a higher speed than the wAt method using bubble sort.

しかしながら、これら従来のデータの編集方法では、個
々のデータをその都度比較しなければならなかったので
、処理を高速化するには限界があった。
However, in these conventional data editing methods, individual data had to be compared each time, so there was a limit to speeding up the processing.

〔目的〕〔the purpose〕

本発明は、このような従来技術の問題を改善し、データ
の編集を一層高速に行なうことの可能なデータの編集方
法を提供することを目的としている。
SUMMARY OF THE INVENTION An object of the present invention is to provide a data editing method that improves the problems of the prior art and allows data editing to be performed even faster.

〔構成〕〔composition〕

本発明は上記目的を達成させるため、対象データメモリ
から編集されるべきコードと大きさとを読出す工程と、
前記対象データメモリから読出されな大きさをソートメ
モリのアドレスとして、このアドレスで定められるソー
トメモリの所定位置に前記読出されたコードを格納する
書込工程と、前記ソートメモリに格納されたコードを順
次に読出す工程とを備えたことを特徴としたものである
In order to achieve the above object, the present invention includes the steps of: reading out the code and size to be edited from the target data memory;
a writing step of storing the read code in a predetermined position of the sort memory determined by the address of the sort memory, using the size of the read data from the target data memory, and writing the code stored in the sort memory. The method is characterized by comprising a step of sequentially reading out data.

以下、本発明の一実施例に基づいて具体的に説明する。Hereinafter, a detailed explanation will be given based on one embodiment of the present invention.

第1図は本発明のデータのmt&方法を実現するための
システムの構成図である。
FIG. 1 is a block diagram of a system for implementing the data mt & method of the present invention.

第1図において、プロセッサ1には、編集の対象となる
データを格納する対象データメモリ2と、対象データメ
モリ2内のデータが大きさ順に格納されるソートメモリ
3と、データの編集処理の作業領域となるワークエリア
4とがデータバスラおよびアドレスバス6によって接続
されている。またプロセッサ1にはレジスタAO,Do
、AI。
In FIG. 1, a processor 1 includes a target data memory 2 that stores data to be edited, a sort memory 3 that stores data in the target data memory 2 in order of size, and a data editing process. A work area 4 serving as an area is connected by a data bus 6 and an address bus 6. Also, processor 1 has registers AO and Do.
, A.I.

Dlが備わっている。It is equipped with Dl.

対象データメモリ2に格納されているデータは、所定の
コードをもち、さらにこのコードにはこれが格納される
ソートメモリ3の相対アドレスすなわち大きさが対応づ
けされている。
The data stored in the target data memory 2 has a predetermined code, and this code is further associated with the relative address, that is, the size, of the sort memory 3 in which the data is stored.

この大きさは、コードがその大きさ順にソートメモリ3
に格納されるように設定されている。
This size allows the code to be sorted in memory 3 in order of size.
It is set to be stored in .

第2図は、対象データメモリ2に格納されているデータ
を示したものである。第2図において、コード“11)
(”は大きさ“7”をもち、またコード“15H”は大
きさ“12″をもっている。
FIG. 2 shows data stored in the target data memory 2. As shown in FIG. In Figure 2, the code “11)
(" has a magnitude of "7", and the code "15H" has a magnitude of "12".

プロセッサ1は、対象データメモリ2から、編集の対象
となるデータの所定のコードと、このコードに対応づけ
された大きさとを読出し、所定のレジスタに記憶するよ
うになっている。さらにプロセッサ1は、所定のレジス
タに記憶された大きさと、予め与えられているソートメ
モリ3の′先頭アドレスすなわちオフセット値TOPと
を加えて。
The processor 1 reads a predetermined code of data to be edited and a size associated with the code from the target data memory 2, and stores them in a predetermined register. Furthermore, the processor 1 adds the size stored in a predetermined register and the 'starting address of the sort memory 3 given in advance, that is, the offset value TOP.

所定のレジスタに記憶されたコードの格納されるべきソ
ートメモリ3の絶対アドレスを求める。そしてこの絶対
アドレスで指示されるソートメモリ3の内容が“0”で
あるときには、その位置にコードなどを゛書込むように
なっている。このような処理は、対象データメモリ2の
全てのデータについて行なわれ、ソートメモリ3には大
きさ順にコートが格納される。
The absolute address of the sort memory 3 where the code stored in the predetermined register is to be stored is determined. When the content of the sort memory 3 specified by this absolute address is "0", a code or the like is written at that location. Such processing is performed on all data in the target data memory 2, and the codes are stored in the sort memory 3 in order of size.

これにより例えば第2図に示すような対象データメモリ
2のデータは、第3図に示すように、大きさ順にソート
メモリ3に格納される。第3図において、ソートメモリ
3の相対アドレス#07にはコード“IIH”が格納さ
れ、また相対アドレス#12にはコード′15H″が格
納される。なお、第3図に示す例は、後述のように第1
の実施例に対応したものであって、第2の実施例では第
8図に示すようにさらにポインタが書込まれる。
As a result, the data in the target data memory 2 as shown in FIG. 2, for example, is stored in the sort memory 3 in order of size, as shown in FIG. In FIG. 3, the code "IIH" is stored in the relative address #07 of the sort memory 3, and the code "15H" is stored in the relative address #12.The example shown in FIG. like 1st
In the second embodiment, a pointer is further written as shown in FIG.

ソートメモリ3内にデータが全て格納されると、プロセ
ッサ1はソートメモリ3を順次にアクセスする。この際
に、ソートメモリ3の内容がO″であればスキップし、
′0”でなければその内容がコードあるいはポインタと
なる。ソートメモリ3の内容が“0″でないと判断され
たときのソートメモリ3の絶対アドレスに基づいてコー
ドおよびこのコードの大きさが得られる。
When all data is stored in the sort memory 3, the processor 1 sequentially accesses the sort memory 3. At this time, if the content of sort memory 3 is O'', it is skipped,
If it is not '0', its contents become a code or a pointer.The code and the size of this code are obtained based on the absolute address of sort memory 3 when it is determined that the contents of sort memory 3 are not '0'. .

第4図および第5図は、本発明に係るデータの編集方法
の第1の実施例を示すフローチャートである。
4 and 5 are flowcharts showing a first embodiment of the data editing method according to the present invention.

第4図は、ソートメモリ3ヘデータを書込む処理のフロ
ーチャートである。
FIG. 4 is a flowchart of the process of writing data into the sort memory 3.

第4図において、ステップS1では、対象データメモリ
2からデータ、すなわち所定のコードおよびこのコード
に対応づけられている大きさを読出す。
In FIG. 4, in step S1, data, ie, a predetermined code and a size associated with this code, are read from the target data memory 2.

次いでステップS2では、読出したコードを第1図に示
ずレジスタDOに格納し、大きさを第1図に示すレジス
タAOに格納する。
Next, in step S2, the read code is stored in a register DO not shown in FIG. 1, and the size is stored in a register AO shown in FIG.

次いでステップS3では、レジスタAOに格納された大
きさと、ソートメモリ3のオフセット値TOPとを加算
し、ソートメモリ3の絶対アドレスを求め、これを再び
レジスタAOに格納する。
Next, in step S3, the size stored in the register AO and the offset value TOP of the sort memory 3 are added to obtain the absolute address of the sort memory 3, and this is stored in the register AO again.

なおソートメモリ3のオフセット値TOPは、対象デー
タメモリ2のデータの格納されるべきソートメモリ3の
先頭アドレスである。
Note that the offset value TOP of the sort memory 3 is the top address of the sort memory 3 where the data of the target data memory 2 is to be stored.

ステップS4では、L/ジスタAOに格納されたソート
メモリ3の絶対アドレス位置をアクセスする。
In step S4, the absolute address position of the sort memory 3 stored in the L/register AO is accessed.

次いでステップS5では、レジスタAOで指示されるソ
ートメモリ3の絶対アドレス位置の内容が°゛0”であ
るか否かを判断する。“0”のときには、ステップS6
に進み、レジスタDOに格納されているコードをレジス
タAOで指示されるソートメモリ3の絶対アドレス位置
へ書込む、ステップS5においてソートメモリ3の絶対
アドレス位置の内容が“0”ではないときには、ステッ
プS7に進み、現在の絶対アドレスを“1″だけ歩進さ
せて再びステップS5に戻る。これにより、ソートメモ
リ3の絶対アドレス位置の内容が“0”の位置まで絶対
アドレスを歩進させて、絶対アドレス位置の内容が“O
”になったときにこの絶対アドレス位置にステップS6
でコードを書込む。
Next, in step S5, it is determined whether the content of the absolute address position of the sort memory 3 specified by the register AO is °'0'. If it is '0', the process proceeds to step S6.
Step S5 writes the code stored in the register DO to the absolute address position of the sort memory 3 indicated by the register AO.If the content of the absolute address position of the sort memory 3 is not "0" in step S5, the code stored in the register DO is written to the absolute address position of the sort memory 3 specified by the register AO. The process advances to S7, increments the current absolute address by "1", and returns to step S5 again. As a result, the absolute address is incremented until the content of the absolute address position of the sort memory 3 is "0", and the content of the absolute address position is "0".
”, the address is moved to this absolute address position in step S6.
Write the code with.

次いでステップS8では、゛対象データメモリ2内の全
てのデータが上述のようにしてソートメモリ3の所定の
絶対アドレス位置に書込まれたか否かを判断する。全て
のデータの書込みがまだ終了していないときには、再び
ステップS1に戻り、ステップS1乃至ステップS7の
同様の処理を繰返す。
Next, in step S8, it is determined whether all the data in the target data memory 2 have been written to the predetermined absolute address positions of the sort memory 3 as described above. If writing of all data has not yet been completed, the process returns to step S1 again and the same processing from step S1 to step S7 is repeated.

ステップS8において、全てのデータの書込みが終了し
たと判断されたときには、データの書込み処理を終了す
る。
In step S8, when it is determined that all data has been written, the data writing process is ended.

第5図に示すフローチャートでは、ソートメモリ3から
書込まれたデータを読出してデータを大きさ順に並べる
処理を行なう。
In the flowchart shown in FIG. 5, the data written from the sort memory 3 is read out and the data is arranged in order of size.

第5図において、ステップS9では、データの総数をn
IIaXとし、データの読出しカウント値nを“1”に
初期設定する0次いでステップSIOでは、ソートメモ
リ3のオフセット値TOPを絶対アドレスの初期値とし
てレジスタAOに格納する。
In FIG. 5, in step S9, the total number of data is n
IIaX, and the data read count value n is initialized to "1".0 Next, in step SIO, the offset value TOP of the sort memory 3 is stored in the register AO as the initial value of the absolute address.

ステップSllでは、レジスタAOで指示されるソート
メモリ3のアドレス位置の内容をレジスタDoに格納す
る。ステップS10においてレジスタAOにはソートメ
モリ3のオフセット値T。
In step Sll, the contents of the address location of the sort memory 3 specified by the register AO are stored in the register Do. In step S10, the offset value T of the sort memory 3 is stored in the register AO.

Pが格納されているので、ステップSllにおいては、
ソートメモリ3のオフセット値TOPの内容、すなわち
ソート領域の最も上位のアドレス位置の内容がレジスタ
Doに格納されたことになる。
Since P is stored, in step Sll,
This means that the contents of the offset value TOP of the sort memory 3, that is, the contents of the highest address position in the sort area, are stored in the register Do.

次いでステップS12では、レジスタpOの内容が“0
”であるか否かを判断する。レジスタDOの内容が“0
”ではないときには、“O”でないデータが存在するの
でステップ313に進み、レジスタDOの内容をコード
とし、このときのレジスタAOの内容からオフセット値
TOPを減算することにより大きさを求める。
Next, in step S12, the contents of register pO become “0”.
”. If the contents of register DO are “0
”, since there is data that is not “O”, the process proceeds to step 313, uses the contents of the register DO as a code, and calculates the size by subtracting the offset value TOP from the contents of the register AO at this time.

一方、ステップS12において、レジスタDOの内容が
“0″のときには、ステップS14に進み、レジスタA
Oに格納されているソートメモリ3の絶対アドレスを“
1”だけ歩進して再びステップSllに戻る。
On the other hand, in step S12, when the content of register DO is "0", the process advances to step S14, and register A
The absolute address of sort memory 3 stored in O is “
The process advances by 1'' and returns to step Sll again.

このようにして、ステップS12においてレジスタDO
の内容が0”ではないナトレス位置までソートメモリ3
の絶対アドレスを歩進させて、ステップS13において
上述したようにコードおよび大きさを求める。
In this way, in step S12, the register DO
Sort memory 3 until the Natres position where the content is not 0''
The absolute address of is incremented, and the code and size are determined in step S13 as described above.

次いでステップS15では、ソートメモリ3のソート領
域をすべてアクセスし、ソート領域をオーバーしたか否
かを判断する。ソート領域をオーバーしたときには、ソ
ート領域が全てアクセスされたことを意味するので処理
を終了する。
Next, in step S15, all the sorting areas of the sorting memory 3 are accessed, and it is determined whether the sorting areas have been exceeded. When the sort area is exceeded, this means that the entire sort area has been accessed, so the process ends.

またステップS15において、ソート領域をオーバーし
ていないと判断されたときには、ステップ316に進み
、データの読出しカウント値nがデータの総数n□8よ
りも大きいか否かを判断する。
If it is determined in step S15 that the sort area has not been exceeded, the process proceeds to step 316, where it is determined whether the data read count value n is greater than the total number of data n□8.

ステップS16において、データの読出しカウント値n
がデータの総数n□8よりも大きいときには、全てのデ
ータの読出しが終了したことを意味するので処理を終了
する。
In step S16, the data read count value n
When is larger than the total number of data n□8, it means that reading of all data has been completed, and the process is ended.

一方、ステップ816においてデータの読出しカウント
値nがデータの総数n□8よりも大きくないときには、
次のデータの読出しを行なうために、ステップ914に
進み、ステップS14においてレジスタAOの内容を“
1”だけ増加させて再びステップSllに戻る。
On the other hand, if the data read count value n is not larger than the total number of data n□8 in step 816,
In order to read the next data, the process advances to step 914, and in step S14, the contents of register AO are
The value is increased by 1'' and the process returns to step Sll.

このようにして、ステップSll乃至ステップS16の
処理を繰返して、ソートメモリ3から“0″ではないデ
ータを順次に読出す。
In this way, the processes from step Sll to step S16 are repeated to sequentially read data that is not "0" from the sort memory 3.

以上のように、この第1の実施例によれば、ソートメモ
リ3ヘデータを書込む際、ソートメモリ3の指示したア
ドレス位置の内容が0”ではない場合には、ソートメモ
リ3の内容が0″になる位置までアドレスを増加させ、
ソートメモリ3の内容が“0″となったときにそのアド
レス位置へデータを書込むようになっている。そしてソ
ートメモリ3の読出し処理では、ソートメモリ3内にデ
ータが大きさ順に格納されているので、これを順次に読
出すだけで良い、従って、個々のデータの比敦処理を行
なう必要なく、ソートメモリ3へのアクセスだけで良い
ので、データ5iii処理を高速に行なうことができる
As described above, according to the first embodiment, when writing data to the sort memory 3, if the content of the address position specified by the sort memory 3 is not 0'', the content of the sort memory 3 is 0''. Increase the address until it becomes ``,
When the content of the sort memory 3 becomes "0", data is written to that address position. In the read processing of the sort memory 3, since the data is stored in the sort memory 3 in order of size, it is only necessary to read the data sequentially. Since it is only necessary to access the memory 3, data 5iii processing can be performed at high speed.

第6図および第7図は、本発明に係るデータのI薬方法
の第2の実施例を示すフローチャートである。
6 and 7 are flowcharts illustrating a second embodiment of the data processing method according to the present invention.

第6図は、ソートメモリ3ヘデータを書込む処理のフロ
ーチャートである。
FIG. 6 is a flowchart of the process of writing data into the sort memory 3.

なお、この第2の実施例では、所定のポインタを格納す
るポインタ格納メモリ(図示せず)を設け、このポイン
タ格納メモリから必要なポインタを取出してソートメモ
リ3に書込んでいる。
In this second embodiment, a pointer storage memory (not shown) for storing predetermined pointers is provided, and necessary pointers are taken out from this pointer storage memory and written into the sort memory 3.

第6図において、ステップS21では、対象データメモ
リ2からデータ、すなわち所定のコードおよびこのコー
ドに対応づけられている大きさ読出す。
In FIG. 6, in step S21, data, ie, a predetermined code and a size associated with this code, are read from the target data memory 2.

次いでステップ322では、読出したコードを第1図に
示ずレジスタDOに格納し、大きさを第1図に示すレジ
スタAOに格納する。
Next, in step 322, the read code is stored in a register DO not shown in FIG. 1, and the size is stored in a register AO shown in FIG.

次いでステップS23では、レジスタAOに格納された
大きさと、ソートメモリ3のオフセット値TOPとを加
算し、ソートメモリ3の絶対アドレスを求め、これを再
びレジスタAOに格納する。
Next, in step S23, the size stored in the register AO and the offset value TOP of the sort memory 3 are added to obtain the absolute address of the sort memory 3, and this is stored in the register AO again.

なおソートメモリ3のオフセット値TOPは、対象デー
タメモリ2のデータの格納されるべきソートメモリ3の
先頭アドレスである。
Note that the offset value TOP of the sort memory 3 is the top address of the sort memory 3 where the data of the target data memory 2 is to be stored.

ステップS24では、レジスタAOに格納されたソート
メモリ3の絶対アドレス位置をアクセスする。
In step S24, the absolute address position of the sort memory 3 stored in the register AO is accessed.

次いでステップS25では、レジスタAOで指示される
ソートメモリ3の絶対アドレス位置の内容が“0″であ
るか否かを判断する。“0″のときには、ステップS2
6に進み、レジスタAOで指示されるソートメモリ3の
絶対アドレス位置にエンドポインタEPを書込む0次い
でステップS27においてレジスタAOで指示される絶
対アドレス位置の次のアドレス位置にレジスタDOに格
納されているコードを書込む、ステップS25において
ソートメモリ3の絶対アドレス位置の内容が“0”では
ないときにきは、ステップ328に進み、レジスタAO
で指示されるソートメモリ3の絶対アドレス位置の内容
がエンドポインタEPであるか否かを判断する。
Next, in step S25, it is determined whether the content of the absolute address position of the sort memory 3 indicated by the register AO is "0". When “0”, step S2
6, the end pointer EP is written to the absolute address position of the sort memory 3 specified by the register AO.0Then, in step S27, the end pointer EP is stored in the register DO at the address position next to the absolute address position specified by the register AO. If the content of the absolute address position of the sort memory 3 is not "0" in step S25, the process advances to step 328, and the register AO is written.
It is determined whether the content of the absolute address position of the sort memory 3 indicated by is the end pointer EP.

エンドポインタEPでない場合には、ステップS29に
進み、レジスタAOで指示されるソートメモリ3の絶対
アドレス位置の内容はエンドポインタEPではないポイ
ンタとなっているので、これをレジスタAOに格納し、
再びステップ328に戻り、この処理をエンドポインタ
EPが検出されるまで繰返す。
If it is not the end pointer EP, the process advances to step S29, and since the content of the absolute address position of the sort memory 3 specified by the register AO is a pointer that is not the end pointer EP, this is stored in the register AO,
Returning again to step 328, this process is repeated until the end pointer EP is detected.

ステップS28において、レジスタAOで指示されるソ
ートメモリ3の絶対アドレス位置の内容がエンドポイン
タEPであると判断された場合には、ステップS30に
進み、ポインタ格納メモリよりもポインタをレジスタA
1に格納する4次いでステップS31ではレジスタA1
の内容をレジスタAOで指示されるソートメモリ3の絶
対アドレス位置に書込む。
In step S28, if it is determined that the contents of the absolute address position of the sort memory 3 indicated by the register AO is the end pointer EP, the process proceeds to step S30, and the pointer is transferred from the pointer storage memory to the register A.
Then, in step S31, the register A1 is stored in the register A1.
The contents of are written to the absolute address position of the sort memory 3 specified by the register AO.

ステップ332では、レジスタAOに先づレジスタA1
の内容を転送し、次いでこれを“1”だけ増加する。従
うてレジスタAOにはレジスタA1に格納されている内
容を“1″だけ増加した値が格納され、ステップ933
では、レジスタAOで指示されるソートメモリ3の絶対
アドレス位置にコードをセットし、ステップS34では
、レジスタA1で指示されるソートメモリ3の絶対アド
レス位置にエンドポインタEPをセットする。この結果
、第8図に示すように、ソートメモリ3には所定のポイ
ンタおよびエンドポインタEPの次のアドレス位置にデ
ータすなわちコードが書込まれることになる。
In step 332, register A1 is entered before register AO.
, and then increment it by "1". Therefore, a value obtained by increasing the contents stored in register A1 by "1" is stored in register AO, and step 933
Then, a code is set at the absolute address position of the sort memory 3 specified by the register AO, and in step S34, an end pointer EP is set at the absolute address position of the sort memory 3 specified by the register A1. As a result, as shown in FIG. 8, data, ie, a code, is written in the sort memory 3 at the address position next to the predetermined pointer and end pointer EP.

このようにしてステップS26.ステップS27あるい
はステップS33.ステップS34においてソートメモ
リ3に所定のデータを書込んだ後、ステップS35に進
む。
In this way, step S26. Step S27 or Step S33. After writing predetermined data into the sort memory 3 in step S34, the process advances to step S35.

ステップS35では、対象データメモリ2内の全てのデ
ータが上述のようにしてソートメモリ3の所定の絶対ア
ドレス位置に書込まれたか否かを判断する。全てのデー
タの書込みがまだ終了していないときには、再びステッ
プ321に戻り、ステップS21乃至ステップS34の
同様の処理を繰返す。
In step S35, it is determined whether all the data in the target data memory 2 have been written to the predetermined absolute address positions of the sort memory 3 as described above. If all data has not been written yet, the process returns to step 321 and repeats the same processes from step S21 to step S34.

ステップS35において全てのデータの書込みが終了し
たと判断されたときには、データの書込み処理を終了す
る。
When it is determined in step S35 that all data has been written, the data writing process is ended.

第7図に示すフローチャートでは、ソートメモリ3から
書込まれたデータを読出してデータを大きさ順に並べる
処理を行なう。
In the flowchart shown in FIG. 7, the data written in the sort memory 3 is read out and the data is arranged in order of size.

第7図において、ステップS36では、データの総数を
nnaxとし、データの読出しカウント値nを1″に初
期設定する1次いでステップS37では、ソートメモリ
3のオフセット値TOPを絶対アドレスの初期値として
レジスタAOに格納する。
In FIG. 7, in step S36, the total number of data is set to nnax, and the data read count value n is initialized to 1''.In step S37, the offset value TOP of the sort memory 3 is registered as the initial value of the absolute address. Store in AO.

ステップS38では、レジスタAOで指示されるソート
メモリ3のアドレス位置の内容をレジスタDoに格納し
、レジスタAOの内容をレジスタD1へ転送する。いま
の場合ステップS37においてレジスタAOにはソート
メモリ3のオフセット値TOPが格納されているので、
ステップS38においては、ソートメモリ3のオフセッ
ト値TOPの内容、すなわちソート領域の最も上位のア
ドレス位置の内容がレジスタDoに格納されたことにな
る。
In step S38, the contents of the address location of the sort memory 3 specified by the register AO are stored in the register Do, and the contents of the register AO are transferred to the register D1. In this case, since the offset value TOP of the sort memory 3 is stored in the register AO in step S37,
In step S38, the contents of the offset value TOP of the sort memory 3, that is, the contents of the highest address position in the sort area are stored in the register Do.

次いでステップS39では、レジスタ]:jOの内容が
“0”であるか否かを判断する。レジスタDOの内容が
0”のときには、ステップS45に進み、レジスタAO
に格納されているソートメモリ3の絶対アドレスを“1
″だけ歩進させて再びステップ338に戻る。この処理
はレジスタDOの内容が“0”でなくなるまで、すなわ
ちポインタが検出されるまで繰返される。ステップS3
9においてレジスタDOの内容が“0”ではなくなった
ときにきは1、ポインタの位置にアドレスが設定された
ことを意味するのでステップS40に進み、レジスタD
Oの内容をレジスタAOに先づ転送する。ソートメモリ
3内ではポインタの次のアドレス位置にデータすなわち
コードが書込まれているので、次のステップ341では
、レジスタAOで指示されるソートメモリ3のアドレス
位置の次のアドレス位置の内容をレジスタDOに格納す
る。このときにレジスタDOの内容がコードとなる0次
いでステップS42では、レジスタD1の内容からオフ
セット値TOPを減算して大きさを求める。
Next, in step S39, it is determined whether the contents of register]:jO are "0". When the contents of register DO are 0'', the process advances to step S45, and register AO is
The absolute address of sort memory 3 stored in
'' and returns to step 338 again. This process is repeated until the contents of register DO are no longer "0", that is, until the pointer is detected.Step S3
When the contents of the register DO are no longer "0" in step S9, this means that the address is set at the pointer position, so the process advances to step S40 and the register D is set to 1.
Transfer the contents of O to register AO first. In the sort memory 3, data, that is, a code, has been written to the address position next to the pointer, so in the next step 341, the contents of the address position next to the address position of the sort memory 3 specified by the register AO are written to the register. Store in DO. At this time, the contents of the register DO become the code 0. Then, in step S42, the size is determined by subtracting the offset value TOP from the contents of the register D1.

このようにしてステップS41およびステップS42に
おいてデータのコードおよび大きさを求めた後、ステッ
プ343に進む。
After determining the code and size of the data in steps S41 and S42 in this manner, the process proceeds to step 343.

ステップ343では、レジスタAOで指示されるソート
メモリ3の絶対アドレス゛位置の内容がエンドポインタ
EPか否かを判断する。エンドポインタEPでないとき
には、その内容は次のコードンを示すポインタであるの
でそのポインタの示すソートメモリ3のアドレス位置を
アクセスするためステップS44に進む、ステップS4
4では、レジスタAOで指示されるソートメモリ3の絶
対アドレス位置の内容をレジスタAOに格納して再びス
テップS40に戻り、この処理をエンドポインタEPが
検出されるまで繰返す。
In step 343, it is determined whether the contents of the absolute address location of the sort memory 3 indicated by the register AO are the end pointer EP. If it is not the end pointer EP, the content is a pointer indicating the next codon, so the process advances to step S44 to access the address location of the sort memory 3 indicated by the pointer, step S4.
In step S4, the contents of the absolute address position of the sort memory 3 specified by the register AO are stored in the register AO, and the process returns to step S40, and this process is repeated until the end pointer EP is detected.

ステップS43において、レジスタAOで指示されるソ
ートメモリ3の絶対アドレス位置の内容がエンドポイン
タEPであると判断されたときには、ステップS45に
進み、ソート領域をオーバーしたか否かを判断する。ソ
ート領域をオーバーしたときには、ソート領域が全てア
クセスされたことを意味するので処理を終了する。
When it is determined in step S43 that the content of the absolute address position of the sort memory 3 indicated by the register AO is the end pointer EP, the process proceeds to step S45, and it is determined whether or not the sort area has been exceeded. When the sort area is exceeded, this means that the entire sort area has been accessed, so the process ends.

またステップS45において、ソート領域をオーバーし
ていないと判断されたときには、ステップS46に進み
、データの読出しカウント値nがデータの総数n  よ
りも大きいか否かを判断すaX る。
If it is determined in step S45 that the sort area has not been exceeded, the process proceeds to step S46, where it is determined whether the data read count value n is greater than the total number n of data.

ステップS46において、データの読出しカウント値n
がデータの総数n1aXよりも大きいときには、全ての
データの読出しが終了したことを意味するので処理を終
了する。
In step S46, the data read count value n
When is larger than the total number of data n1aX, it means that reading of all data has been completed, and the process is ended.

一方、ステップS46において、データの読出しカウン
ト値nがデータの総数n1aXよりも大きくないときに
は、次のデータの読出しを行なうためにステップS45
に進み、ステップS45においてレジスタAOの内容を
“1′だけ増加させて再びステップ938に戻る。
On the other hand, in step S46, if the data read count value n is not larger than the total number of data n1aX, step S45 is performed to read the next data.
Then, in step S45, the contents of register AO are incremented by "1", and the process returns to step 938.

このようにして、ステップ338乃至ステップS46の
処理を繰返して、ソートメモリ3から“0”ではないデ
ータを順次に読出す。
In this manner, the processes from step 338 to step S46 are repeated to sequentially read data that is not "0" from the sort memory 3.

以上のように、この第2の実施例によれば、ポインタを
用いているので、同じ大きさをもつデータが複数存在す
る場合でも、データの消滅を防ぐことができる。
As described above, according to the second embodiment, since pointers are used, it is possible to prevent data from disappearing even when a plurality of pieces of data having the same size exist.

〔効果〕〔effect〕

以上に説明したように、本発明によれば、対象データメ
モリから読出された大きさに従って、コードを大きさ順
にソートメモリに格納するようになっているので、個々
のデータを比較する必要はなく、データの編集処理を高
速に行なうことができる。
As explained above, according to the present invention, codes are stored in the sort memory in order of size according to the size read from the target data memory, so there is no need to compare individual data. , data editing processing can be performed at high speed.

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

第1図は本発明のデータの編集方法を実現するシステム
の構成図、第2図は対象データメモリに格納されている
データのコードおよび大きさを示す図、第3図は第2図
に示すデータをソートメモリに格納した状態を示す図、
第4図および第5図は本発明に係るデータのWa&方法
の第1の実施例を示すフローチャート、第6図および第
7図は本発明に係るデータのw4薬方法の第2の実施例
を示すフローチャート、第8図は第2の実施例によって
データをソートメモリに格納した状態を示す図、第9図
はバブルソートを説明するための図であり、第9図(a
)は最初のデータ並びを示す図、第9図(b)は第9図
(a)に示すデータ並びを並び換えた状態を示す図、第
9図(C)は第9図(b)に示すデータ並びを並び換え
た状態を示す図、第9図(d)は第9図(C)に示すデ
ータ並びを並び換えた状態を示す図である。 2・・・対象データメモリ、3・・・ソートメモリ、A
O,AI、Do、DI・・・レジスタ、EP・・・エン
ドポインタ 特許出願人  株式会社  リ コ −第  1  図 第  2  図 第  3  図 第  4  図 第  5  図 第  6  図 第  7  図 第  8  図
Figure 1 is a block diagram of a system that implements the data editing method of the present invention, Figure 2 is a diagram showing the code and size of data stored in the target data memory, and Figure 3 is shown in Figure 2. A diagram showing the state in which data is stored in sort memory,
4 and 5 are flowcharts showing the first embodiment of the data Wa&method according to the present invention, and FIGS. 6 and 7 show the second embodiment of the data w4 drug method according to the present invention. FIG. 8 is a diagram showing a state in which data is stored in the sort memory according to the second embodiment, and FIG. 9 is a diagram for explaining bubble sort.
) is a diagram showing the initial data arrangement, FIG. 9(b) is a diagram showing the rearranged data arrangement shown in FIG. 9(a), and FIG. 9(C) is a diagram showing the data arrangement shown in FIG. 9(b). FIG. 9(d) is a diagram showing a rearranged state of the data array shown in FIG. 9(C). 2...Target data memory, 3...Sort memory, A
O, AI, Do, DI...Register, EP...End pointer Patent applicant Rico Co., Ltd. - Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8

Claims (1)

【特許請求の範囲】 1)対象データメモリから編集されるべきコードと大き
さとを読出す工程と、前記対象データメモリから読出さ
れた大きさをソートメモリのアドレスとして、このアド
レスで定められるソートメモリの所定位置に前記読出さ
れたコードを格納する書込工程と、前記ソートメモリに
格納されたコードを順次に読出す工程とを備えたことを
特徴とするデータの編集方法。 2)前記書込工程は、前記ソートメモリの前記アドレス
の位置に読出されたコードを格納することを特徴とする
特許請求の範囲第1項に記載のデータの編集方法。 3)前記書込工程は、前記ソートメモリの前記アドレス
の位置に所定のポインタを格納し、前記アドレスの次の
位置にコードを格納することを特徴とする特許請求の範
囲第1項に記載のデータの編集方法。
[Claims] 1) A step of reading out the code and size to be edited from the target data memory, and setting the size read from the target data memory as the address of the sort memory, and creating a sort memory defined by this address. A data editing method comprising: a writing step of storing the read code at a predetermined position in the sort memory; and a step of sequentially reading out the codes stored in the sort memory. 2) The data editing method according to claim 1, wherein the writing step stores the read code at the address location of the sort memory. 3) The writing step stores a predetermined pointer at the address position of the sort memory, and stores a code at the next position of the address. How to edit data.
JP523787A 1987-01-13 1987-01-13 Data editing method Pending JPS63173124A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP523787A JPS63173124A (en) 1987-01-13 1987-01-13 Data editing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP523787A JPS63173124A (en) 1987-01-13 1987-01-13 Data editing method

Publications (1)

Publication Number Publication Date
JPS63173124A true JPS63173124A (en) 1988-07-16

Family

ID=11605588

Family Applications (1)

Application Number Title Priority Date Filing Date
JP523787A Pending JPS63173124A (en) 1987-01-13 1987-01-13 Data editing method

Country Status (1)

Country Link
JP (1) JPS63173124A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009199439A (en) * 2008-02-22 2009-09-03 Nec Corp Merge sort processing method, merge sort processing device, and merge sort processing program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009199439A (en) * 2008-02-22 2009-09-03 Nec Corp Merge sort processing method, merge sort processing device, and merge sort processing program

Similar Documents

Publication Publication Date Title
JPS63173124A (en) Data editing method
US6311266B1 (en) Instruction look-ahead system and hardware
US4811213A (en) Vector processor with vector registers
JPS59111533A (en) Digital data arithmetic circuit
US5937403A (en) Integer permutation method and integer permutation system
JPS5851330A (en) Character processor
JPS63239521A (en) Data processing system for magnetic tape device
JPH01228022A (en) Tow-dimensional data storing system
JPH0350594A (en) Display system for large-amount data
EP0348030A3 (en) Computing sequence result availability
JPS619687A (en) Memory control system
JPH04195344A (en) Register file read mechanism
JPS63148349A (en) Cache memory positioning system
JPS6168636A (en) Data processor
JPH03260870A (en) Projection system for data base assist
JPS63253431A (en) Retrieving system for data base of inverted structure
JPH02156318A (en) Data management system
JPS63153655A (en) Memory access control system
JPS6476339A (en) Processing system for restoration of editing data
JPS62231346A (en) Data storage system
JPS6116365A (en) Vector data processor
JPS59142791A (en) Access control system of stack memory
JPH0118431B2 (en)
JPH0340073A (en) Image reader
JPH01270127A (en) Data retrieval processing system