JPS6350731B2 - - Google Patents

Info

Publication number
JPS6350731B2
JPS6350731B2 JP55073520A JP7352080A JPS6350731B2 JP S6350731 B2 JPS6350731 B2 JP S6350731B2 JP 55073520 A JP55073520 A JP 55073520A JP 7352080 A JP7352080 A JP 7352080A JP S6350731 B2 JPS6350731 B2 JP S6350731B2
Authority
JP
Japan
Prior art keywords
program
line
pad
label
proceed
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
JP55073520A
Other languages
Japanese (ja)
Other versions
JPS57751A (en
Inventor
Isamu Haneda
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 JP7352080A priority Critical patent/JPS57751A/en
Publication of JPS57751A publication Critical patent/JPS57751A/en
Publication of JPS6350731B2 publication Critical patent/JPS6350731B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Description

【発明の詳細な説明】 本発明はプログラム電子式卓上計算機、パーソ
ナルコンピユータ等の計算機(以下、単に計算機
と記す。)にプログラム編集機能を持たせたプロ
グラム編集機能付き計算機に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a computer with a program editing function, such as a programmable electronic desktop calculator or a personal computer (hereinafter simply referred to as a computer).

従来より、プログラム言語としてベーシツク
(BASIC)を使用する計算機において、複数個の
プログラムを計算機に入れる場合、これらをまと
めて一つのプログラムとなるようにプログラミン
グすることが考えられているが、このようにする
と、プログラムに同じラインが複数個存在する可
能性があり、プログラムの実行に支障が起る問題
があつた。
Conventionally, when putting multiple programs into a computer that uses BASIC as the programming language, it has been considered to program them together into one program. As a result, there is a possibility that the same line may exist multiple times in the program, causing problems in program execution.

また、プログラムのラインナンバを自動的に付
け変えるリナンバリング機能を有する計算機にお
いて、ジヤンプ命令で指定がラインナンバの場
合、ラインナンバを式で指定するときには、この
式の内容を変えることができなくなる他に、リナ
ンバリングするための作業メモリが必要となる問
題があつた。
In addition, in a computer that has a renumbering function that automatically changes the line number of a program, if the jump instruction specifies a line number, when the line number is specified by an expression, the contents of this expression cannot be changed. However, there was a problem in that working memory was required for renumbering.

本発明の目的は、一つのプログラムとそれに追
加されるいま一つのプログラムをまとめて一つの
プログラムとして実行処理できるようにしたプロ
グラム編集機能を有するプログラム編集機能付き
計算機を提供することである。
An object of the present invention is to provide a computer with a program editing function that allows one program and another program added to it to be collectively executed as one program.

このため、本発明は、第1のプログラムと該第
1のプログラムに追加される第2のプログラムを
実行処理できるプログラム電子式卓上計算機、パ
ーソナルコンピユータ等のプログラム編集機能付
き計算機において、 上記第1と第2のプログラムとの間をジヤンプ
させる際にはラベル名で指定し、実行中の同一プ
ログラム内でのジヤンプをラインナンバで指定す
る構成としたことを特徴としている。
Therefore, the present invention provides a computer with a program editing function, such as a program electronic desktop calculator or a personal computer, which can execute a first program and a second program added to the first program. The present invention is characterized in that a jump from a second program is specified by a label name, and a jump within the same program being executed is specified by a line number.

以下、本発明の実施例を示す図面を参照して詳
細に説明する。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

第1図において、1はCPU(中央処理装置)、
2はROM(読み出し専用メモリ)、3はRAM(ラ
ンダムアクセスメモリ)、4はキー、5は表示メ
モリ及びバツフア、6は表示体である。CPU1
はROM2に予め書き込まれた手順に従つて、キ
ー4を読み込んだり、表示体6に表示させるデー
タを表示メモリ及びバツフア5に書き込んだり、
必要によつてはキー入力された内容をRAM3に
書き込んだり、或いはRAM3の内容を表示体6
に表示させたりする。ROM2はキー4の読み込
みや表示を行なうための手順(モニタ)やRAM
3に書き込まれたプログラムに従つて動作する手
順(インタプリタ)が予め書き込まれてある。
RAM3はプログラムやデータを記憶するエリア
である。キー4はCPU1からのストローブ信号
Sとキー信号Kのマトリクスになつており、英数
字、記号等のキーから成る。表示メモリ及びバツ
フア5は表示体6に表示させるデータが書き込ま
れると、表示体6に合つた信号に変換されて出力
される。Aはアドレスバス、Dはデータバス、
R/Wはリード/ライト信号、SINはシリアル入
力信号、SOUTはシリアル出力信号である。
In Figure 1, 1 is a CPU (central processing unit),
2 is a ROM (read only memory), 3 is a RAM (random access memory), 4 is a key, 5 is a display memory and buffer, and 6 is a display body. CPU1
reads the keys 4, writes data to be displayed on the display 6 to the display memory and buffer 5, according to the procedure written in advance in the ROM 2,
If necessary, the key input contents can be written to RAM 3, or the contents of RAM 3 can be written to display 6.
to be displayed. ROM2 contains the procedure (monitor) and RAM for reading and displaying key 4.
A procedure (interpreter) that operates according to the program written in 3 is written in advance.
RAM3 is an area for storing programs and data. The keys 4 are a matrix of strobe signals S and key signals K from the CPU 1, and are comprised of alphanumeric, symbol, etc. keys. When data to be displayed on the display 6 is written into the display memory and buffer 5, it is converted into a signal suitable for the display 6 and output. A is address bus, D is data bus,
R/W is a read/write signal, S IN is a serial input signal, and S OUT is a serial output signal.

上記のCPU1の一部のブロツク図を第2図に
示す。
A block diagram of a portion of the CPU 1 mentioned above is shown in FIG.

上記第2図において、7は命令デコーダ、8は
命令レジスタ、10はレジスタ及びフラグ、11
はアドレスバツフア、12はアキユムレータ、1
3はテンポラリレジスタ、14はALU(演算回
路)、15はキヤリー、16はSバツフア、17
はKバツフア、18はSOUTバツフア、19はSIN
バツフア、20は内部データバスである。
In FIG. 2 above, 7 is an instruction decoder, 8 is an instruction register, 10 is a register and flag, and 11 is an instruction decoder.
is the address buffer, 12 is the accumulator, 1
3 is a temporary register, 14 is an ALU (arithmetic circuit), 15 is a carry, 16 is an S buffer, 17
is K buttuhua, 18 is S OUT butfua, 19 is S IN
Buffer 20 is an internal data bus.

プログラム言語としてベーシツクを例にとり、
更に周辺機器としてテープレコーダを考える。プ
ログラムが記録されている磁気テープからプログ
ラムを計算機に転送する命令として、CLOAD
文、CLOAD1文がある。CLOAD文は磁気テープ
のプログラムをプログラムメモリの先頭より転送
するのに対し、CLOAD1文はプログラムメモリ
に格納されているプログラムに続いて転送され
る。なお、磁気テープへのプログラムの記憶は、
SOUT信号より得られ、磁気テープからの再生信号
はSINに入力され、各々テープレコーダと計算機
の間にインターフエイスを介して、所望の信号に
変換されるものとする。
Taking Basic as an example of a programming language,
Furthermore, consider a tape recorder as a peripheral device. CLOAD is an instruction that transfers a program from the magnetic tape on which it is recorded to a computer.
There is a statement, CLOAD1 statement. The CLOAD statement transfers the program on the magnetic tape from the beginning of the program memory, whereas the CLOAD1 statement transfers the program following the program stored in the program memory. Note that the program is stored on magnetic tape.
It is assumed that a reproduced signal obtained from the S OUT signal and reproduced from the magnetic tape is input to S IN , and is converted into a desired signal through an interface between the tape recorder and the computer.

第3図にCLOAD文及びCLOAD1文のフローチ
ヤートを示す。OBTMはプログラムがプログラ
ムメモリのどこに入つているかを示すポインタ、
PADはプログラムの番地を示すポインタ、FLG
1はCLOAD1文かCLOAD文かを示すグラグ、
Erはエラーフラグ、CAは転送を中断することを
示すフラグ、ACCはデータを取り扱うレジスタ
である。
Figure 3 shows a flowchart of the CLOAD statement and CLOAD1 statement. OBTM is a pointer that indicates where the program is located in program memory.
PAD is a pointer indicating the program address, FLG
1 is a flag indicating whether it is a CLOAD1 statement or a CLOAD statement,
Er is an error flag, CA is a flag indicating to interrupt transfer, and ACC is a register that handles data.

はCLOAD文なので、転送先のプログラフメモ
リのポインタPADをクリアする。
Since this is a CLOAD statement, it clears the pointer PAD in the program memory of the transfer destination.

はCLOAD1文を示すフラグFLG1をリセツト
する。
resets flag FLG1 indicating the CLOAD1 statement.

はPADをクリアする。clears the PAD.

はプログラムメモリにどこ迄プログラムが入つ
ているか示すポインタOBTMとPAD(クリア
されている)を比較する。もし、一致しておれ
ば、プログラムメモリの先頭より転送するの
で、CLOAD文と同じことになるのでに進
む。
compares the pointer OBTM, which indicates how far the program is in program memory, with PAD (which is cleared). If they match, the data will be transferred from the beginning of the program memory, which is the same as the CLOAD statement, so proceed.

にて一致しないとき、OBTMが示す次の
番地より転送するため、OBTMをPADに転送
し、 PADを+1する。
If they do not match, OBTM is transferred to PAD and PAD is incremented by 1 in order to transfer from the next address indicated by OBTM.

このとき、PADがプログラムメモリの領域を
越えるときには、もうこれ以上プログラムメモ
リに転送はできないのでエラー処理に進む。
At this time, when the PAD exceeds the area of the program memory, it is no longer possible to transfer it to the program memory, so the process proceeds to error processing.

もし、PADがプログラムメモリ内の番地を
示すとき、CLOAD1文を示すFLG1をセツト
する。
If PAD points to an address in program memory, set FLG1 to point to the CLOAD1 statement.

CAフラグ及びエラーフラグをリセツトする。 Reset the CA flag and error flag.

磁気テープから再生された信号をSINより受
け取り、これを並列信号に変換し、ACCに転
送する。なお、ここでは、再生信号を読み取つ
ている間にエラーが発生したときには、Erフ
ラグをセツトし、CAキーが入力されたときに
はCAフラグをセツトする。
It receives the signal reproduced from the magnetic tape from S IN , converts it into a parallel signal, and transfers it to ACC. Here, when an error occurs while reading the reproduced signal, the Er flag is set, and when the CA key is input, the CA flag is set.

にて読み取り中にエラーが発生したり
(Er=1)、CAキーにて転送を中断させたとき
(CA=1)には、直ちに転送を中断するために
に進む。
If an error occurs during reading (Er = 1) or if the transfer is interrupted using the CA key (CA = 1), proceed to immediately to interrupt the transfer.

再生された内容が転送の終了を示すか否か判
断し、 終了でないとき、ACCをプログラムメモリ
に転送し、 PADを+1する。
Determine whether the reproduced content indicates the end of the transfer. If not, transfer ACC to program memory and increment PAD by 1.

そして、PADがプログラムメモリの番地を
越えるか判断する。越えるときにはエラー処理
をするためにに進む。越えないときには次の
転送内容を得るためにに戻る。
Then, it is determined whether the PAD exceeds the address of the program memory. When it exceeds, proceed to error handling. If not, return to obtain the next transfer content.

にてACCが転送終了を示すとき、PADを
−1し、 PADをOBTMに転送する。これによつて、
どこ迄プログラムが入つているかOBTMを参
照することによつてわかる。
When ACC indicates the end of transfer, PAD is decremented by 1 and PAD is transferred to OBTM. By this,
You can see how far the program is included by referring to OBTM.

そして、計算機は転送が終了したことを示
し、新たな指令を受けるために、キー4のリー
ドインに進み、ここでキー4を読みに行く。
The computer then indicates that the transfer is complete and proceeds to the key 4 lead-in where it reads key 4 in order to receive a new command.

にてエラーが発生したり、転送を中断する
ことを指令されたとき及びにてPADがプロ
グラムメモリの番地を越えたとき、プログラム
メモリにどこ迄プログラムが格納されているか
を示すOBTMを設定するためにFLG1を判定
し、 FLG1がセツトされているとき、CLOAD1
文実行中であつたので、転送前に入つていたプ
ログラムは有効なので、OBTMはそのままに
し、 FLG1がリセツトされているときには、プ
ログラムをクリアする必要があるために、
OBTMをクリアする。
To set the OBTM that indicates how far the program is stored in the program memory when an error occurs or a command is given to interrupt the transfer, or when the PAD exceeds the address of the program memory. When FLG1 is set, CLOAD1 is determined.
Since the statement was being executed, the program that was entered before the transfer was valid, so OBTM was left as is, and when FLG1 was reset, the program needed to be cleared, so
Clear OBTM.

ここでは、転送中にエラーが発生したのか、
中断されたのかを知るためにCAフラグを判定
し、 CAフラグがリセツトされているとき、転送
中にエラーが生じたために、エラーが発生した
ことを示すエラー処理に進む。
Here, whether an error occurred during the transfer or
The CA flag is checked to see if the transfer was interrupted, and if the CA flag is reset, an error occurred during the transfer, so proceed to error handling indicating that an error has occurred.

〓〓 CAフラグがセツトされているときには、CA
処理に進む。
〓〓 When the CA flag is set, the CA
Proceed to processing.

第4図にプログラム編集のフローチヤートを示
す。LINEは入力されたプログラムのラインナン
バーを記憶するレジスタ、LINE′はプログラムを
サーチした際得られるプログラムラインのライン
ナンバーを記憶するレジスタである。
FIG. 4 shows a flowchart of program editing. LINE is a register that stores the line number of the input program, and LINE' is a register that stores the line number of the program line obtained when searching for a program.

は挿入削除するプログラムのラインナンバーを
LINEに記憶し、 PADをクリアし、 既に計算機にプログラムが記憶されてあるか
否か知るために、PADとOBTMを比較する。
is the line number of the program to be inserted or deleted.
Store it in LINE, clear PAD, and compare PAD and OBTM to find out whether the program is already stored in the computer.

既にプログラムが記憶されているときには、
PADとOBTMは一致しないので、挿入すべき
プログラムの挿入位置或いは削除するプログラ
ムラインの位置を見つけるために、プログラム
メモリに記憶されているプログラムの最終番地
OBTMをPADに転送する。これは捜す位置を
最終位置より始めるためである。
If the program is already stored,
Since PAD and OBTM do not match, the last address of the program stored in program memory is used to find the insertion position of the program to be inserted or the position of the program line to be deleted.
Transfer OBTM to PAD. This is because the search position starts from the final position.

PADが示す位置よりプログラムメモリの先
頭に向つて、PADが一番近いプログラムライ
ンのラインナンバーを見つけて、これを
LINE′に転送する。そして、PADはこの位置
を示している。もし、プログラムラインを見つ
けるとき、PADがプログラムメモリの先頭番
地を示すとき、捜す位置はプログラムメモリの
先頭なのでに進む。
Find the line number of the program line closest to the PAD toward the beginning of the program memory from the position indicated by the PAD, and select this.
Transfer to LINE′. And PAD shows this position. If, when finding a program line, PAD indicates the beginning address of program memory, the search position is the beginning of program memory, so proceed.

見つけたプログラムラインとこれから挿入削
除するプログラムラインのラインナンバーを比
較する。もし、LINE<LINE′ならば、挿入削
除する位置はもつと前にあるのでに戻る。
Compare the line numbers of the found program line and the program line to be inserted or deleted. If LINE<LINE′, the insertion/deletion position is earlier than the previous one, so go back.

もしLINE=LINE′ならば、 新しいプログラムラインを挿入するために、
既に記憶されているプログラムラインを削除
し、OBTMを更新する。
If LINE=LINE′, to insert a new program line,
Delete already stored program lines and update OBTM.

挿入するプログラムがプログラムメモリ内に
収まるか否か調べ、もし収まらないときには
のエラー処理に進む。
Check whether the program to be inserted will fit in the program memory, and if it does not fit, proceed to error handling.

挿入するプログラムはプログラムメモリ内に
収まるので、PADが示すプログラムメモリ番
地にプログラムを挿入し、OBTMを更新する。
ただし、挿入プログラムがラインナンバーのと
きには何もしない(これはプログラムラインを
削除するための操作である)。
Since the program to be inserted fits within the program memory, the program is inserted at the program memory address indicated by PAD and OBTM is updated.
However, when the inserted program is a line number, nothing is done (this is an operation for deleting a program line).

挿入削除後、次の動作に移るためにキーリー
ドインに進む。
After insertion/deletion, proceed to key lead-in to proceed to the next operation.

これによつて、計算機に複数個のプログラムが
記憶されている場合、最後のプログラムに対して
挿入削除ができる。最後のプログラムに対して可
能なことは、磁気テープよりプログラムをロード
後、ロード直後のプログラムに対してプログラム
編集ができることを意味する。
With this, when a plurality of programs are stored in the computer, it is possible to insert or delete the last program. What is possible for the last program means that after loading the program from the magnetic tape, it is possible to edit the program immediately after loading.

例えば、第5図に示すように、プログラムメモ
リに2個のプログラムが入つている場合、
「15:′ABC′GOTO10」を追加すると、第6図に
示すように、最後のプログラムに挿入される。
For example, as shown in Figure 5, if two programs are stored in the program memory,
When "15:'ABC'GOTO10" is added, it is inserted into the last program as shown in Figure 6.

次にプログラム実行のジヤンプについて説明す
る。第7図にジヤンプ命令GOTO文のフローチ
ヤートを示す。PAD′はPADの補助レジスタ、
LINE″はプログラム実行中のプログラムライン
のラインナンバーが記憶されているレジスタ、
LABELはGOTO文の指定するラベルを記憶する
レジスタ、LABEL′はプログラムラインのラベル
を記憶するレジスタである。
Next, jumps in program execution will be explained. FIG. 7 shows a flowchart of the jump command GOTO statement. PAD′ is the auxiliary register of PAD,
LINE” is a register that stores the line number of the program line during program execution.
LABEL is a register that stores the label specified by the GOTO statement, and LABEL' is a register that stores the label of the program line.

はジヤンプ先が無いときにはエラーにするため
に、どこでエラーになつたかを示すために、実
行中のプログラム番地PADをPAD′に転送し、
エラーになつたときにはPAD′が示す位置がエ
ラーの位置である。
transfers the program address PAD being executed to PAD′ to indicate where the error occurred, in order to generate an error when there is no jump destination.
When an error occurs, the position indicated by PAD' is the error position.

GOTO文のジヤンプ指定がラベルか否か判
定する。ラベル指定の場合は第6図の
「20GOTO′ABC′」のように′で挾む。
Determine whether the jump specification in the GOTO statement is a label. When specifying a label, use '' as in ``20GOTO'ABC''' in Figure 6.

ジヤンプ先のラベルをLABELに転送し、 このラベルと同一のラベルをもつプログラム
ラインをプログラムメモリの先頭より捜すため
にPADをクリアする。
Transfers the jump destination label to LABEL, and clears PAD to search for a program line with the same label as this label from the beginning of program memory.

プログラムラインのラベルは第6図の
「15′ABC′GOTO10」のように、ラインナンバ
ーの次に′で挾む。PADが示す位置より
OBTMの方向にラベルを捜す。もし、ラベル
が見つからないときにはジヤンプ先が無いので
に進む。ラベルが見つかれば、そのラベルを
LABEL′に転送し、その位置をPADに移す。
The program line label is placed next to the line number with ', like ``15'ABC'GOTO10'' in Figure 6. From the position indicated by PAD
Look for labels in the direction of OBTM. If the label is not found, there is no place to jump to, so proceed. If a label is found, use the label
LABEL′ and its position to PAD.

そして、このLABEL′が指定のラベルか否か
判定し、もし一致するときには、このラベルを
もつプログラムラインより命令を実行するため
にに進む。一致しないときには、続けてラベ
ルを見つけるためにに戻る。
Then, it is determined whether this LABEL' is a specified label or not, and if they match, the program proceeds to execute the instruction from the program line having this label. If there is no match, go back to continue finding the label.

にてジヤンプ指定がラベルでないとき、指
定がラインナンバーか否か判定する。もし、ラ
インナンバーでもないときにはに進む。
When the jump designation is not a label, it is determined whether the designation is a line number. If it is not a line number, proceed to .

ジヤンプ先のラインナンバーをLINEに転送
し、 ジヤンプ先が現在実行中のラインより前後に
あるか否か判断し、 ジヤンプ先が実行中のラインの後にあるとき
には、PADよりOBTM方向に向かつて一番近
いプログラムラインのラインナンバーを
LINE′に転送し、PADをこの位置に移す。
PAD以降にプログラムがないときにはに進
む。
Transfer the jump destination line number to LINE, determine whether the jump destination is before or after the currently executing line, and if the jump destination is after the currently executing line, select the line number that is closest to the OBTM direction from the PAD. Line number of the nearest program line
Transfer to LINE′ and move PAD to this position.
If there is no program after PAD, proceed to .

得られたプログラムラインナンバーLINE′と
LINEを比較し、LINEがLINE′より大きいと
きには、ジヤンプ先はもつと後方にあるので
に戻る。LINEがLINE′より大きくないときに
はに進む。
The obtained program line number LINE′ and
Compare the LINEs, and if LINE is greater than LINE′, the jump destination is further back, so return to the previous step. If LINE is not greater than LINE′, proceed to .

LINEとLINE′が等しいか否か判定し、等し
いときにはこのプログラムラインがジヤンプ先
なので、このラインへ実行を移すためにに進
み、等しくないときには指定のジヤンプ先がな
いのでに進む。
Determine whether LINE and LINE' are equal. If they are equal, this program line is the jump destination, so proceed to move the execution to this line; if they are not equal, there is no specified jump destination, so proceed.

にてLINEがLINE″より大きくないときに
は、ジヤンプ先は実行中のラインを含む実行ラ
イン以前にあるので、PADが示す位置よりプ
ログラムの先頭の逆方向に、一番近いプログラ
ムラインのラインナンバを捜し、これをLINE
に移すと同時にPADをこの位置にする。もし、
PADより先頭方向にプログラムラインがない
ときにはに進む。
If LINE is not larger than LINE'', the jump destination is before the execution line that includes the line that is being executed, so search for the line number of the nearest program line in the opposite direction from the beginning of the program from the position indicated by PAD. , put this on LINE
and move the PAD to this position at the same time. if,
If there is no program line in the head direction from PAD, proceed to .

LINEとLINE′を比較し、LINEがLINE′よ
り小さいときには、ジヤンプ先はもつと前方に
あるのでに戻る。LINEがLINE′より小さく
ないときにはに進む。
Compare LINE and LINE′, and if LINE is smaller than LINE′, the jump destination is further forward, so return to the previous point. If LINE is not smaller than LINE′, proceed to .

上記のジヤンプ例を第6図に示す。 An example of the above jump is shown in FIG.

次にプログラムを実行させる方法について述べ
る。第8図にプログラムを走らせる命令RUN文
のフローチヤートを示す。
Next, we will discuss how to run the program. Figure 8 shows a flowchart of the RUN statement that runs the program.

はPADをクリアし、 計算機にプログラムが記憶されているか判定
するために、PADとOBTMを比較する。PAD
とOBTMが等しいときにはプログラムは記憶
されていないので、直ちにに進み、次の指令
を待つ。
clears PAD and compares PAD and OBTM to determine whether the program is stored in the computer. P.A.D.
When and OBTM are equal, the program has not been memorized, so it immediately proceeds and waits for the next command.

RUNの後、開始指定ラインがなく、
ENTERのときにはプログラムの先頭より実行
を開始するので、RUNの後がENTERか否か
判定する。ENTERのときにはに進む。
After RUN, there is no specified start line,
When it is ENTER, execution starts from the beginning of the program, so it is determined whether ENTER occurs after RUN. When you press ENTER, proceed to .

ENTERでないときには、開始指定がラベル
か否か判定する。
If it is not ENTER, determine whether the start specification is a label.

ラベルのないときにはラベルをLABELに転
送し、 PADが示す位置よりOBTMの方向に向かつ
て、ラベルをもつプログラムラインを捜し、見
つかれば、そのラベルをLABEL′に移し、その
位置をPADに移す。もし見つからないときに
は、ジヤンプ先がないのでに進む。
If there is no label, transfer the label to LABEL, move from the position indicated by PAD in the direction of OBTM, search for a program line with a label, and if found, move the label to LABEL' and move that position to PAD. If it is not found, there is no jump destination, so proceed.

得られたLABEL′とLABELを比較し、一致
したときにはそのラインより実行を始めるため
にに進み、一致しないときには更に次のラベ
ルを見つけるためにに戻る。
The obtained LABEL' and LABEL are compared, and if they match, proceed to start execution from that line, and if they do not match, return to find the next label.

にて指定開始がラベルでないときには、指
定開始がラインナンバーか否か判定する。ライ
ンナンバーでもないときにはに進む。
If the specified start is not a label, it is determined whether the specified start is a line number. If there is no line number, proceed to .

指定のラインナンバーをLINEに移し、 PADが示す位置からOBTMの方向に向かつ
て、一番近いプログラムラインのラインナンバ
ーを見つけて、これをLINEに移し、この位置
にPADを移す。もし、PAD以降にプログラム
ラインのラインナンバーが見つからないときに
は、ジヤンプ先がないのでに進む。
Move the specified line number to LINE, move from the position indicated by PAD in the direction of OBTM, find the line number of the nearest program line, move it to LINE, and move PAD to this position. If the line number of the program line is not found after PAD, there is no place to jump to, so proceed.

LINEとLINE′を比較し、LINEがLINE′よ
り大きいときには、実行開始するプログラムラ
インがもつと後方にあるのでに戻る。
Compare LINE and LINE′, and if LINE is greater than LINE′, the program line to start execution is at the back of the line, so return to LINE′.

LINEとLINE′が等しいか否か判定し、等し
いときにはこのラインより実行開始するために
に進み、等しくないときには、指定のライン
がないのでに進む。
Determine whether LINE and LINE′ are equal or not. If they are equal, proceed to start execution from this line; if they are not equal, proceed to the specified line because there is no such line.

これによつて、計算機に複数個のプログラムが
ある場合、プログラムのラインにラベルを付ける
ことにより任意のラインより実行開始でき、ライ
ンナンバーで指定すると、そのラインナンバーと
同じ、一番最初のプログラム内のラインナンバー
のラインより実行開始されることになる。
As a result, if there are multiple programs on the computer, you can start execution from any line by labeling the lines of the program, and if you specify a line number, the first program with the same line number. Execution will start from the line with the line number.

以上の通り、本発明によれば、第1のプログラ
ムとこれに追加されるような第2のプログラムと
の間でプログラムを処理する計算機において、第
1と第2のプログラムとの間の、プログラム間の
ジヤンプをラベル名で行い、ラインナンバ指定に
よるジヤンプは実行中のプログラム中で行なうよ
うにしたから、一つのプログラム中で指定された
ラインナンバと同一のラインナンバが他のプログ
ラム中に存在してもそのラインへはジヤンプする
ことがなく、例えば、既に周辺機器に記録してあ
るプログラムをいくつか計算機に入れて使いたい
とき、周辺機器からのプログラムの転送を既に格
納されているプログラムに続くように行なうと、
必要なプログラムだけを選んで計算機に転送し
て、実行できる。また、互いに関係あるプログラ
ムで、他のプログラムへジヤンプしたいときには
ラベル名でジヤンプでき、そのプログラム内でジ
ヤンプするときにはラインナンバで行なうように
すると、全く関係のないプログラムを複数個計算
機にて夫々において処理でき、その際に追加され
る第2のプログラム等においては、第1のプログ
ラムのラインナンバと同一のラインナンバを使用
してもよく、プログラムの作成を容易にできる等
の利点を有する。
As described above, according to the present invention, in a computer that processes programs between a first program and a second program added thereto, Jumps between lines are performed using label names, and jumps due to line number specifications are performed within the running program, so the same line number as the line number specified in one program exists in another program. For example, when you want to use some programs that have already been stored in a peripheral device in your computer, you can transfer the program from the peripheral device to the program that has already been stored. If you do it like this,
You can select only the programs you need, transfer them to your computer, and run them. Also, if you want to jump to another program in mutually related programs, you can jump by label name, and when jumping within that program, you can do it by line number, so that multiple unrelated programs can be processed individually on each computer. The second program added at that time may use the same line number as the first program, which has the advantage of making the program easier to create.

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

第1図は計算機の構成を示すブロツク図、第2
図はCPUの一部のブロツク図、第3図はCLOAD
文およびCLOAD1文のフローチヤート、第4図
はプログラム編集のフローチヤート、第5図はプ
ログラムメモリに入つているプログラムの説明
図、第6図は第5図のプログラムの編集後のプロ
グラムの説明図、第7図はGOTO文のフローチ
ヤート、第8図はRUN文のフローチヤートであ
る。 1……CPU、2……ROM、3……RAM、4
……キー、5……表示メモリ及びバツフア、6…
…表示体、7……命令デコーダ、8……命令レジ
スタ、10……レジスタ及びフラグ。
Figure 1 is a block diagram showing the configuration of the computer, Figure 2 is a block diagram showing the configuration of the computer.
The figure is a block diagram of a part of the CPU, and the third figure is CLOAD.
Flowchart of the statement and CLOAD1 statement, Figure 4 is a flowchart of program editing, Figure 5 is an explanatory diagram of the program stored in the program memory, and Figure 6 is an explanatory diagram of the program after editing the program in Figure 5. , Figure 7 is a flowchart of the GOTO statement, and Figure 8 is a flowchart of the RUN statement. 1...CPU, 2...ROM, 3...RAM, 4
...Key, 5...Display memory and buffer, 6...
...Display body, 7...Instruction decoder, 8...Instruction register, 10...Register and flag.

Claims (1)

【特許請求の範囲】 1 第1のプログラムと該第1のプログラムに追
加される第2のプログラムを実行処理できるプロ
グラム電子式卓上計算機、パーソナルコンピユー
タ等のプログラム編集機能付き計算機において、 上記第1と第2のプログラムとの間をジヤンプ
させる際にはラベル名で指定し、実行中の同一プ
ログラム内でのジヤンプをラインナンバで指定す
る構成としたことを特徴とするプログラム編集機
能付き計算機。
[Scope of Claims] 1. A computer with a program editing function, such as a program electronic desktop calculator or a personal computer, capable of executing a first program and a second program added to the first program, A computer with a program editing function characterized in that a jump between a second program and a second program is specified by a label name, and a jump within the same program being executed is specified by a line number.
JP7352080A 1980-05-30 1980-05-30 Computer with program editing function Granted JPS57751A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7352080A JPS57751A (en) 1980-05-30 1980-05-30 Computer with program editing function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7352080A JPS57751A (en) 1980-05-30 1980-05-30 Computer with program editing function

Publications (2)

Publication Number Publication Date
JPS57751A JPS57751A (en) 1982-01-05
JPS6350731B2 true JPS6350731B2 (en) 1988-10-11

Family

ID=13520595

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7352080A Granted JPS57751A (en) 1980-05-30 1980-05-30 Computer with program editing function

Country Status (1)

Country Link
JP (1) JPS57751A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63268031A (en) * 1987-04-24 1988-11-04 Sharp Corp Program execution control system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4984756A (en) * 1972-12-22 1974-08-14
JPS52116036A (en) * 1976-03-25 1977-09-29 Casio Comput Co Ltd Program processing system
JPS5441644A (en) * 1977-09-09 1979-04-03 Casio Comput Co Ltd Undefined line number display system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4984756A (en) * 1972-12-22 1974-08-14
JPS52116036A (en) * 1976-03-25 1977-09-29 Casio Comput Co Ltd Program processing system
JPS5441644A (en) * 1977-09-09 1979-04-03 Casio Comput Co Ltd Undefined line number display system

Also Published As

Publication number Publication date
JPS57751A (en) 1982-01-05

Similar Documents

Publication Publication Date Title
JPS6122817B2 (en)
JPS6350731B2 (en)
US4816992A (en) Method of operating a data processing system in response to an interrupt
JPS6266330A (en) Loading device for instruction counter
JPS6315632B2 (en)
JPS58114275A (en) Pattern information retrieving system
JPS6032220B2 (en) information processing equipment
JP2525809B2 (en) Search device
JPH0721766B2 (en) FORTRAN I / O control processor
JP2545828B2 (en) Data display device
JP3120493B2 (en) Data processing device
JP2721377B2 (en) BASIC program compression method
JPS5955506A (en) Sequence controller
JP2570407B2 (en) Programmable controller
JPH025175A (en) Character processor
JPH02257282A (en) Table preparation processor
JPH05346867A (en) Processor for restarting data transfer
JP2933222B2 (en) Document processing device
JPH05143391A (en) Memory tracing method for virtual storage type computer
JPS6046747B2 (en) Initial program loading method
JPH01130237A (en) Information processor
JPS62204338A (en) Lisp language processing system
JPH0775017B2 (en) Memory access method
JPS6038741B2 (en) Program and data recording/playback method
JPS6231378B2 (en)