JPH02270027A - Storage system for variable - Google Patents

Storage system for variable

Info

Publication number
JPH02270027A
JPH02270027A JP9210888A JP9210888A JPH02270027A JP H02270027 A JPH02270027 A JP H02270027A JP 9210888 A JP9210888 A JP 9210888A JP 9210888 A JP9210888 A JP 9210888A JP H02270027 A JPH02270027 A JP H02270027A
Authority
JP
Japan
Prior art keywords
variable
substituted
character
storage
characters
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
JP9210888A
Other languages
Japanese (ja)
Inventor
Naoki Shiraishi
奈緒樹 白石
Yasuhiko Takano
高野 泰彦
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP9210888A priority Critical patent/JPH02270027A/en
Publication of JPH02270027A publication Critical patent/JPH02270027A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PURPOSE:To facilitate the control in a variable storage system by preparing a substituted character storage part and a variable storage part and storing the variable names of the variable storage part in order of addresses. CONSTITUTION:A substituted character storage part 2 stores the contents to be substituted for the variables, and a variable storage part 1 stores a pair of a variable name and the address information showing a specific position of the part 2 that stores the storage contents corresponding to the variable name. Then the variable names of the part 1 are stored in order of addresses. In other words, the constitution of a character string variable is divided into a part where a character variable itself is shown and a part where a substituted character string is stored. Then a pointer showing the latter part is added to the former part and at the same time a variable substitution process is carried out so as to secure an arrangement rule in each area of both parts. Thus an unused memory is easily secured. As a result, the addresses can be easily rewritten in response to the variable names at fluctuation of the number of substituted characters.

Description

【発明の詳細な説明】 〈産業上の利用分野〉 本発明は代入式によシ可変長の文字を代入出来るプログ
ラム式コンピューターの変数の記憶方式に関するもので
ある。
DETAILED DESCRIPTION OF THE INVENTION <Industrial Application Field> The present invention relates to a variable storage system for a programmable computer that allows variable-length characters to be assigned to an assignment expression.

〈従来の技術〉 第3図は従来技術の記憶装置の記憶状態を示したもので
ある。変数名記憶部Iにはアルファベット順に変数名が
記憶されておシそれに対応して代入出来る最高の文字数
である16文字分の代入文字記憶部2が予め設けられて
いる。又別の従来技術としては第4図に示すように、変
数名記憶部1にアルファベット順に変数名を記憶してお
きこの変数名に代入されている代入文字が代入文字記憶
部2のどのアドレスに記憶されていて何文字分の文字を
記憶出来るかを変数名に対応させて変数名記憶部1に記
憶させた方法がある。この方法は代入文字記憶部2に代
入する文字が少ない場合でも接近させて記憶させる事が
出来、又代入出来る文字数も記録容量以外は特に限定す
る必要がなく代入文字記憶部2の記憶容量有効使用が出
来る。この代入文字を呼び出す時には、まず変数記憶部
1の変数を検索しその変数に対応して記憶されているア
ドレスと文字数を読み出し代入文字記憶部2の前記アド
レスから前記文字分のデーターを読み出す事により変数
に対する代入文字が読み出される事になる。
<Prior Art> FIG. 3 shows the storage state of a storage device of the prior art. The variable name storage section I stores variable names in alphabetical order, and is previously provided with a substitution character storage section 2 for 16 characters, which is the maximum number of characters that can be substituted. Another conventional technique, as shown in FIG. 4, stores variable names in alphabetical order in a variable name storage section 1, and determines which address in the assignment character storage section 2 the substitution character assigned to this variable name is assigned to. There is a method in which the number of characters that can be stored is stored in the variable name storage unit 1 in correspondence with the variable name. With this method, even if there are few characters to be substituted in the substitution character storage section 2, they can be stored close together, and the number of characters that can be substituted does not need to be particularly limited other than the storage capacity, so the storage capacity of the substitution character storage section 2 can be used effectively. I can do it. When calling this substitution character, first search the variable in the variable storage unit 1, read out the address and number of characters stored corresponding to that variable, and read the data for the character from the address in the substitution character storage unit 2. The assignment character for the variable will be read.

〈発明が解決しようとする問題点〉 しかしながら、第3図の従来例では1つの変数に対し常
に16文字分の代入文字記憶部が必要となる為、代入す
る文字が3文字であれば残シの13文字分の記憶部は無
駄なものとなってしまう。しかし代入文字記憶部2の文
字数を少なくすると代入文字が増えた時に対応出来ない
為条目に確保しておく必要がある。
<Problems to be solved by the invention> However, in the conventional example shown in Fig. 3, a substitution character storage unit for 16 characters is always required for one variable, so if there are only 3 characters to be substituted, there are no remaining characters. The memory section for 13 characters becomes wasted. However, if the number of characters in the substitute character storage section 2 is reduced, it will not be possible to cope with the increase in the number of substitute characters, so it is necessary to reserve them for each row.

さらに第4図に示した従来技術では変数名記憶部Iはア
ルファベット等の固定された順番に変数名が記憶されて
いて、代入文字記憶部2は入力された順に記憶されて行
く為に代入文字記憶部2に記憶されている代入文字数が
増えるなど後の代入文字をずらす必要がある場合変数名
記憶部lの変数名と代入文字記憶部2の代入文字に一定
の関係が無い為変数名記憶部lのアドレスの書き替が大
変に複雑な制御となってしまう。なお、3は空き領域で
るる。
Furthermore, in the prior art shown in FIG. 4, variable names are stored in the variable name storage section I in a fixed order such as alphabetically, and the substitution character storage section 2 stores the substitution characters in the order in which they are input. If the number of substitution characters stored in storage unit 2 increases, and it is necessary to shift the subsequent substitution characters, the variable name storage unit 2 will not remember the variable name because there is no fixed relationship between the variable name in the variable name storage unit l and the substitution character in the substitution character storage unit 2. Rewriting the address of part l requires extremely complicated control. Note that 3 is an empty area.

く問題を解決するための手段〉 本発明の変数の記憶方式は、少なくとも変数に代入する
内容を記憶する代入文字記憶部と、変数名と該変数名に
対応する記憶内容が前記代入文字記憶部のどの位置に記
憶しているかを示すアドレス情報とを対にして記憶して
いる変数記憶部とを備え、該変数記憶部の変数名を前記
アドレス順に記憶させた事を特徴とする。
Means for Solving Problems> The variable storage method of the present invention includes an assignment character storage section that stores at least contents to be assigned to variables, and a substitution character storage section that stores variable names and storage contents corresponding to the variable names. It is characterized by comprising a variable storage section storing address information indicating in which position in the variable storage section the variables are stored in pairs, and the variable names in the variable storage section are stored in the order of the addresses.

く作 用〉 文字列変数の構成を文字変数自身を表わす部分と代入し
た文字列を記憶する部分とに分割し、前者の部分に後者
の部分を指し示すポインタを加えるとともに、両部会の
各々の領域中での並べ方に規則性を持たせるような変数
代入処理を行うことで、未使用メモリを容易に確保する
Function: Divide the structure of a string variable into a part that represents the character variable itself and a part that stores the substituted string, add a pointer to the latter part to the former part, and add a pointer to each area of both parts. Unused memory can be easily secured by performing variable assignment processing that gives regularity to the way they are arranged.

〈実施例〉 本発明の一実施例を図面を参照しながら説明する。<Example> An embodiment of the present invention will be described with reference to the drawings.

第1図は本発明の変数名、代入文字の記憶状態を示した
図でるる。2は変数に代入された内容を記憶する代入文
字記憶部、lは変数名と、該変数名に対応する記憶内容
が前記代入文字記憶部2のどの位置に記憶しているかを
示すアドレスと、代入出来る文字数とを対に記憶してい
る変数記憶部である。なお、3は空領域、4は未使用領
域である。
FIG. 1 is a diagram showing the storage state of variable names and substitution characters according to the present invention. 2 is an assignment character storage unit that stores contents assigned to variables, l is a variable name, and an address indicating in which position of the assignment character storage unit 2 the storage content corresponding to the variable name is stored; This is a variable storage unit that stores the number of characters that can be substituted in pairs. Note that 3 is an empty area and 4 is an unused area.

第2図は本発明の代入文字数変更時の働きを示すフロチ
ャート図である。
FIG. 2 is a flowchart showing the operation of the present invention when changing the number of substituted characters.

第2図にて本発明の変数代入処理の流れを説明する。変
数代入処理が発生すると、 Slにて代入する変数名が既に使用されているかを変数
記憶部Iの変数名をサーチする事により検索する。この
時読に変数名が変数記憶部1に記憶されているのならS
2へ、記憶されていないのならS9へ処理を進める。
The flow of variable assignment processing according to the present invention will be explained with reference to FIG. When variable assignment processing occurs, the variable name in the variable storage section I is searched to see if the variable name to be assigned has already been used in Sl. At this time, if the variable name is stored in variable storage section 1, S
If the information is not stored, the process advances to S9.

S2では検索された変数名に対応して記憶されている代
入出来る文字数と代入しようとする文字数とを比較し代
入する文字数の方が多ければS3へ、同じかめるいは少
なければS8へ進む。
In S2, the number of characters that can be substituted and the number of characters to be substituted stored corresponding to the searched variable name is compared, and if the number of characters to be substituted is greater, the process proceeds to S3, and if the number of characters to be substituted is less, the process proceeds to S8.

S3では代入出来る文字数と代入しようとする文字数の
差の文字数分の数だけ代入文字記憶部に使用されていな
い記憶領域が有るかを判断し有ればS4へ無いならS5
へ進める。
In S3, it is determined whether there is an unused storage area in the substitution character storage unit equal to the number of characters that is the difference between the number of characters that can be substituted and the number of characters to be substituted.
Proceed to.

S4では差の文字分だけそれ以降の記憶文字情報をシフ
トさせ代入文字が記憶出来るだけの記憶領域を確保する
In S4, subsequent memory character information is shifted by the amount of the difference character to secure a storage area sufficient to store the substitute character.

S5では代入出来る文字数と実際に代入されている文字
数を比較し空きの領域3が有るかをそれぞれの文字記憶
情報に対して比較し1つでも空き領域が有ればS6へ、
無い時にはエラーとなる。
In S5, the number of characters that can be substituted is compared with the number of characters that have actually been substituted, and it is compared with each character storage information to see if there is a free area 3. If there is even one free area, the process goes to S6.
An error will occur if it does not exist.

S6ではその領域を詰めていく。この時に本発明の記憶
方法は、代入文字が記憶されている順に変数名が、記憶
されている為変数名記憶部1ば、代入文字記憶部と順に
書き替え処理を行うことが出来る。この時まず既に代入
されている変数名以前の情報が詰められそれでも記憶領
域が足シない時はそれ以降の情報が後に詰められる。
In S6, we will refine this area. At this time, in the storage method of the present invention, since the variable names are stored in the order in which the substitution characters are stored, the rewriting process can be performed in the variable name storage section 1 and the substitution character storage section in this order. At this time, the information before the variable name that has already been assigned is packed first, and if there is still not enough storage space, the information after it is packed after.

S7ではS6の結果で記憶領域が確保出来たかを判断し
確保出来たならS8へ確保出来なかった時はエラーとな
る。
In S7, it is determined whether the storage area was secured based on the result of S6, and if it was secured, an error occurs in S8 if the storage area could not be secured.

S8では上記記憶領域に代入する文字情報等を新たに書
き込みアドレス、文字数等の情報を書き替える。
In S8, character information etc. to be substituted into the storage area is newly written, and information such as the address and number of characters is rewritten.

S9ではS3と同様に記憶されていない記憶領域が有る
かを判断し有ればSI3へ、無い時はSIOへ進む。
In S9, similarly to S3, it is determined whether there is a storage area that is not stored, and if there is, the process proceeds to SI3, and if there is not, the process proceeds to SIO.

510、Sll、 S12、ではS5.S6.S7、と
同様の働きを行う。
510, Sll, S12, then S5. S6. It performs the same function as S7.

SI3では変数名記憶部の一番最後に記憶されている変
数名、アドレス、文字数情報の後に今回入力された変数
名、アドレス、文字数情報を書き足す。これと同じに代
入文字記憶部の最後に記憶されている代入文字情報の後
に、今回入力された代入文字情報が記憶される。
In SI3, the variable name, address, and character count information input this time are added after the variable name, address, and character count information stored at the end of the variable name storage section. Similarly, the currently input substitute character information is stored after the substitute character information stored last in the substitute character storage section.

く効 果〉 以上説明したように、本発明によれば、代入文字数変動
時に行う変数名に対応するアドレス占き替えを同じに行
える為簡単な制御にて行う事が出来る。
Effects> As explained above, according to the present invention, the address replacement corresponding to the variable name, which is performed when the number of assigned characters changes, can be performed in the same way, so it can be performed with simple control.

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

第1図は本発明の一実施例である記憶状態を示しだ図。 第2図は本発明の代入文字数変更時の働きを示すフロチ
ャート図。第3図及び第4図は従来技術の記憶状態を示
した図である。 t tt支幻乙trap、 zbxt<>、文字”a”
j’  、! ta984代理人 弁理士 杉 山 毅
 至(他1名)第1図 第2図 第3図 第4図
FIG. 1 is a diagram showing a storage state according to an embodiment of the present invention. FIG. 2 is a flowchart showing the operation of the present invention when changing the number of substituted characters. FIGS. 3 and 4 are diagrams showing storage states of the prior art. t ttShigen Otsu trap, zbxt<>, letter “a”
j',! ta984 agent Patent attorney Takeshi Sugiyama (and 1 other person) Figure 1 Figure 2 Figure 3 Figure 4

Claims (1)

【特許請求の範囲】[Claims] 1、プログラム式コンピューターの変数記憶方式に於て
、少なくとも変数に代入する内容を記憶する代入文字記
憶部と、変数名と該変数名に対応する記憶内容が前記代
入文字記憶部のどの位置に記憶しているかを示すアドレ
ス情報とを対にして記憶している変数記憶部とを備え、
該変数記憶部の変数名を前記アドレス順に記憶させた事
を特徴とする変数の記憶方式。
1. In the variable storage method of a programmable computer, there is an assignment character storage section that stores at least the content to be assigned to a variable, and where in the assignment character storage section the variable name and the memory content corresponding to the variable name are stored. and a variable storage unit that stores address information indicating whether the
A variable storage method characterized in that variable names in the variable storage section are stored in the order of the addresses.
JP9210888A 1988-04-14 1988-04-14 Storage system for variable Pending JPH02270027A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9210888A JPH02270027A (en) 1988-04-14 1988-04-14 Storage system for variable

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9210888A JPH02270027A (en) 1988-04-14 1988-04-14 Storage system for variable

Publications (1)

Publication Number Publication Date
JPH02270027A true JPH02270027A (en) 1990-11-05

Family

ID=14045236

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9210888A Pending JPH02270027A (en) 1988-04-14 1988-04-14 Storage system for variable

Country Status (1)

Country Link
JP (1) JPH02270027A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61116664A (en) * 1984-11-12 1986-06-04 Mitsubishi Electric Corp Voltage detector

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61116664A (en) * 1984-11-12 1986-06-04 Mitsubishi Electric Corp Voltage detector

Similar Documents

Publication Publication Date Title
US6049802A (en) System and method for generating a linked list in a computer memory
JPH03266039A (en) Free format data link processing system
JPH02270027A (en) Storage system for variable
JPS617874A (en) Display unit
JPS5882344A (en) Interruption control system
JPH03214335A (en) Computer system
JP3553093B2 (en) Data file system
JPH10240627A (en) Sector management method and apparatus
JPH037979B2 (en)
JPH04223537A (en) Image file storing system
JPS63280356A (en) Buffer management system for virtual disk device
JPS63213042A (en) Method for extending file area
JPH01166124A (en) Volume shared control system
JPH06332508A (en) Programmable controller
JPH0399343A (en) Additional record control processing system
JPH0156411B2 (en)
JPH0378043A (en) Data update system for direct-read-after-write draw) type medium
JPS6144339B2 (en)
JPS6020253A (en) Memory control system
JPH0224714A (en) Data processor
JPH01184558A (en) Data storing system
JPS60101667A (en) Reading system of content of diagnosis and treatment code
JPH0231278A (en) Data processor
JPS58123145A (en) State history storage device
JPH0245823A (en) Printing method