JPH0321939B2 - - Google Patents
Info
- Publication number
- JPH0321939B2 JPH0321939B2 JP56070959A JP7095981A JPH0321939B2 JP H0321939 B2 JPH0321939 B2 JP H0321939B2 JP 56070959 A JP56070959 A JP 56070959A JP 7095981 A JP7095981 A JP 7095981A JP H0321939 B2 JPH0321939 B2 JP H0321939B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- memory
- program
- ans
- cpu
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/02—Digital computers in general; Data processing equipment in general manually operated with input through keyboard and computation using a built-in program, e.g. pocket calculators
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
Description
【発明の詳細な説明】
この発明はプリント命令(表示命令)によつて
出力されたデータを保持するメモリを設け、その
データを後にマニユアル計算等で使えるようにし
たプログラム付小型電子計算機に関する。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a small-sized electronic computer with a program, which is provided with a memory for holding data output by a print command (display command) so that the data can be used later for manual calculations, etc.
従来、プログラム付小型電子計算機においてプ
ログラム内の演算命令により演算された結果、出
力された数値データをマニユアル演算で使用する
ためには、該プログラムの中でマニユアル演算に
使用したい数値データをあらかじめ変数メモリの
中に入れた後、該プログラム終了後にその変数を
呼び出すことにより行なわれていた。例えば、該
プログラムとして
10PRINT SIN(×↑2)
と組まれていてその演算結果をマニユアル計算で
使用したい場合には
10A=SIN(×↑2)
20PRINT A
というプログラムを実行させ、その後例えばA×
123のような計算式を実行していた。このため、
プログラムの演算結果をマニユアル計算で使用す
る場合には変数の代入処理などを行なうプログラ
ムを追加してプログラムの内容を変化させなけれ
ばならず面倒であるという欠点があつた。 Conventionally, in order to use numerical data output as a result of calculations by calculation instructions in a program in a manual calculation in a small electronic computer with a program, the numerical data to be used for manual calculation in the program must be stored in variable memory in advance. This was done by calling the variable after the program ended. For example, if the program is 10PRINT SIN (×↑2) and you want to use the calculation result in manual calculation, run the program 10A=SIN (×↑2) 20PRINT A, and then, for example,
It was executing a calculation formula like 123. For this reason,
When the calculation results of a program are used in manual calculations, it is necessary to add a program that performs variable assignment processing and the like to change the contents of the program, which is troublesome.
更に、最後に表示されているデータを用いてマ
ニユアル計算を行なう場合、例えば「30」と表示
されているときに
30×123
の如き計算は行なうことができるが、上記データ
を式の途中に使う計算、例えば
SIN(30)×123
の如き計算は不可能であつた。 Furthermore, when performing manual calculations using the last displayed data, for example, when "30" is displayed, calculations such as 30×123 can be performed, but the above data cannot be used in the middle of the formula. Calculations such as SIN(30)×123 were not possible.
この発明は上記の点に鑑みてなされたもので、
プログラム付小型電子計算機においてプログラム
中で算出された数値データをプログラム内容を変
更せずにマニユアル演算でも使用できるようにし
たプログラム付小型電子計算機を提供することに
ある。 This invention was made in view of the above points,
To provide a small-sized computer with a program in which numerical data calculated in the program can be used in manual calculations without changing the contents of the program.
以下、図面を参照してこの発明の一実施例を説
明する。第1図は統計演算機能及びBASIC言語
によるプログラム演算機能を備えた小型電子計算
機の全体のブロツク図である。図において、11
はキーボードで置数キー、各種機能キー等を備え
ている。上記各種機能キーのうちには統計用デー
タを入力する「STAT」キー、一度入力した統
計用データを削除する「DEL」キー、動作を停
止する「STOP」キー、動作を継続する
「CONT」キー、演算の実行を開始する「EXE」
キー等が含まれている。このキーボード11と
CPU(中央処理装置)12とはバスラインで接続
されており、CPU12からはキーサンプリング
信号が入力される。そして、上記キーボード11
からはキー操作信号が上記CPU12に入力され
る。該CPU12の詳細な構成については後述す
る。また、CPU12にはプリンタ13、表示ド
ライバ14がそれぞれ接続されている。この表示
ドライバ14には例えば液晶によりドツト表示を
行なう表示装置15が接続されており、前記
CPU12から送られてくる表示データに応じて
液晶を駆動する駆動信号を上記表示装置15に送
出している。さらにまた、CPU12にはANSメ
モリ16、ANS符号判定回路17、SD,LR判
定回路18、TX,TYレジスタを備えたメモリ
19、配列判定回路20、データメモリ21、文
字メモリ22、プログラムメモリ23、統計デー
タ制御部24、WAITメモリ25がそれぞれ接
続されている。上記ANSメモリ16はプログラ
ムメモリ23に記憶されているプログラムが実行
され、そのプログラム中のプリント命令(表示命
令)によつてプリンタ13あるいは表示装置15
に出力された数値データが一時保持されるメモリ
でCPU12から送出される読出し/書込み信号
R/Wによりデータの読出し、書込みが制御され
る。また、上記ANSメモリ16は保持された数
値データが負数であるか否かを示すフラグ領域を
有しており、数値データが負数の場合には信号ラ
インaを介して“1”信号がANS符号判定回路
17に送出される。このANS符号判定回路17
には前記CPU12から送られる判定要求信号b
が入力される。さらに、ANS符号判定回路17
は上記判定要求信号bに応じて前記ANSメモリ
16に保持される数値データが負数であるか否か
を示す判定信号cをCPU12に送出する。また、
ANS符号判定回路17には内部のフリツプフロ
ツプ(図示せず)にセツト信号d、リセツト信号
eがCPU12より入力される。そして、この
ANS符号判定回路17からは上記フリツプフロ
ツプのQ出力が信号fとして前記CPU12に送
出される。また、上記SD,LR判定回路18には
前記CPU12からキー入力データが入力され、
キーボード11から入力されたデータが単一入力
の統計データが2入力の統計データか否か判定さ
れる。この判定はキーボード11上の「STAT」
キーを操作して統計データを入力する場合、xデ
ータとyデータとの間にキー操作される「,」コ
ードを検出して入力された統計データが単一入力
の統計データか2入力の統計データを検出するも
のである。このSD,LR判定回路18は「,」コ
ードを検出すると検出信号gを前記CPU12に
送出する。また、前記CPU12からSD,LR判定
回路18にリセツト信号hが入力される。さら
に、SD,LR判定回路18からメモリ19には統
計データが送られるもので、TXレジスタにはx
データがTYレジスタにはyデータが記憶され
る。上記配列判定回路20はプログラムメモリ2
3に記憶されるプログラムの変数の次元を判定す
るもので、変数の次元を示す信号iは前記CPU
12に送出される。次に、上記データメモリ21
は変数データあるいは1次元あるいは2次元の配
列データが記憶される。 Hereinafter, one embodiment of the present invention will be described with reference to the drawings. FIG. 1 is an overall block diagram of a small electronic computer equipped with statistical calculation functions and program calculation functions written in BASIC language. In the figure, 11
is a keyboard with numeric keys and various function keys. Among the various function keys listed above, the ``STAT'' key is used to input statistical data, the ``DEL'' key is used to delete statistical data once input, the ``STOP'' key is used to stop operation, and the ``CONT'' key is used to continue operation. , "EXE" to start executing the operation
Contains keys etc. This keyboard 11
It is connected to a CPU (central processing unit) 12 via a bus line, and a key sampling signal is input from the CPU 12. And the above keyboard 11
From there, key operation signals are input to the CPU 12. The detailed configuration of the CPU 12 will be described later. Further, a printer 13 and a display driver 14 are connected to the CPU 12, respectively. A display device 15 that performs dot display using, for example, a liquid crystal is connected to the display driver 14.
A drive signal for driving the liquid crystal is sent to the display device 15 in accordance with display data sent from the CPU 12. Furthermore, the CPU 12 includes an ANS memory 16, an ANS sign determination circuit 17, an SD and LR determination circuit 18, a memory 19 having TX and TY registers, an array determination circuit 20, a data memory 21, a character memory 22, a program memory 23, A statistical data control unit 24 and a WAIT memory 25 are connected to each other. The program stored in the program memory 23 is executed, and the ANS memory 16 is operated by the printer 13 or the display device 15 according to a print command (display command) in the program.
The reading and writing of data is controlled by the read/write signal R/W sent from the CPU 12 in the memory where the numerical data outputted to is temporarily held. Further, the ANS memory 16 has a flag area indicating whether or not the held numerical data is a negative number, and when the numerical data is a negative number, a "1" signal is sent to the ANS code via the signal line a. The signal is sent to the determination circuit 17. This ANS sign determination circuit 17
is the judgment request signal b sent from the CPU 12.
is input. Furthermore, the ANS sign determination circuit 17
In response to the determination request signal b, the CPU 12 sends a determination signal c indicating whether or not the numerical data held in the ANS memory 16 is a negative number. Also,
A set signal d and a reset signal e are input from the CPU 12 to an internal flip-flop (not shown) in the ANS code determination circuit 17. And this
The Q output of the flip-flop is sent from the ANS code determination circuit 17 to the CPU 12 as a signal f. Further, key input data is inputted from the CPU 12 to the SD/LR determination circuit 18,
It is determined whether the data input from the keyboard 11 is single-input statistical data or two-input statistical data. This judgment is made by pressing "STAT" on the keyboard 11.
When inputting statistical data by operating keys, detect the key operated "," code between x data and y data, and check whether the input statistical data is single input statistical data or two input statistical data. It detects data. When the SD/LR determination circuit 18 detects the "," code, it sends a detection signal g to the CPU 12. Further, a reset signal h is inputted from the CPU 12 to the SD/LR determination circuit 18. Furthermore, statistical data is sent from the SD/LR judgment circuit 18 to the memory 19, and the TX register is
Y data is stored in the TY register. The arrangement determination circuit 20 is a program memory 2
3, and the signal i indicating the dimension of the variable is determined by the CPU
It is sent out on 12th. Next, the data memory 21
is stored with variable data or one-dimensional or two-dimensional array data.
また、上記文字メモリ22は表示出力するデー
タを記憶しているもので、その記憶できる文字数
は可変である。しかして、上記データメモリ21
に記憶可能な文字変数は各7文字であるが、この
文字メモリ22に記憶可能な文字変数の容量は例
えば30文字となつている。また、上記プログラム
メモリ23はユーザプログラムが記憶されるもの
で、そのユーザプログラムは前記CPU12に送
られて実行される。また、上記統計データ制御部
24は内部に基本統計量を記憶しているメモリを
備えており、このメモリには度数n、x総和、y
縦和、x二乗和、y二乗和、xy積和を記憶して
いる。また、統計データ制御部24内部にはタイ
マを備えており、このタイマは前記CPU12よ
り送出されるスタート信号jにより計時を開始す
るもので、例えば2秒を計時するとエンド信号k
を前記CPU12に送出する。このタイマは上記
基本統計データを順次自動的に表示させるための
ものである。また、上記WAITメモリ25はプ
ログラム実行時に前記表示装置15に表示される
データの表示を一時停止させる時間が設定される
メモリで、前記CPU12から読出し/書込み信
号lが入力されている。また、上記WAITメモ
リ25に設定されるWAIT時間はWAIT制御部
26に送出される。また、上記WAITメモリ2
5に設定されたWAIT時間が所定時間以上の場
合にはオーバフロー信号mをWAIT制御部26
に出力する。また、前記CPU12において表示
命令(PRINT)が実行されると、信号nが上記
WAIT制御部26に入力される。そして、この
WAIT制御部26は、上記WAIT時間が経過す
るとRESTART信号を上記CPU12に出力する。
また、前記プリンタ13はプリンタがON状態の
時に信号oを上記WAIT制御部26に出力する。 The character memory 22 stores data to be displayed and output, and the number of characters that can be stored is variable. However, the data memory 21
The character variables that can be stored in the character memory 22 are each seven characters, but the capacity of the character variables that can be stored in the character memory 22 is, for example, 30 characters. Further, the program memory 23 stores a user program, and the user program is sent to the CPU 12 and executed. Further, the statistical data control section 24 is provided with a memory that stores basic statistics, and this memory stores the frequency n, x total, y
It stores the vertical sum, x-squared sum, y-squared sum, and xy-product sum. Further, the statistical data control section 24 is provided with a timer, and this timer starts measuring time in response to a start signal j sent from the CPU 12. For example, when 2 seconds are counted, an end signal k is generated.
is sent to the CPU 12. This timer is for automatically displaying the basic statistical data in sequence. Further, the WAIT memory 25 is a memory in which a time for temporarily stopping the display of data displayed on the display device 15 during program execution is set, and a read/write signal l is input from the CPU 12. Further, the WAIT time set in the WAIT memory 25 is sent to the WAIT control section 26. In addition, the above WAIT memory 2
If the WAIT time set to 5 is longer than the predetermined time, the overflow signal m is sent to the WAIT control unit 26.
Output to. Furthermore, when the display command (PRINT) is executed in the CPU 12, the signal n is
It is input to the WAIT control section 26. And this
The WAIT control unit 26 outputs a RESTART signal to the CPU 12 when the WAIT time has elapsed.
Further, the printer 13 outputs a signal o to the WAIT control section 26 when the printer is in the ON state.
第2図は第1図におけるCPU12の詳細な構
成を示すものである。図において、31は各種マ
イクロプログラムが記憶されているROM(リー
ド・オンリ・メモリ)で、このマイクロプログラ
ムは制御部32に送られてその命令が解読され
る。この制御部32はシステム全体の制御を行う
もので、各種制御命令、アドレス指定信号、チツ
プ指定信号等を出力する。制御部32と演算部3
3間には演算データ及び演算制御信号が送受さ
れ、各種演算が実行される。また、この制御部3
2には前記WAIT制御部26からRESTART信
号が入力される。このRESTART信号は停止し
ているCPU12の動作を再開させる信号である。
34はX、Y、Z、A〜Eレジスタを備えた内部
メモリで演算データ、表示データ、置数データ等
を保持し、上記制御部32とデータ及びアドレス
情報が送受される。また、制御部32にはキー制
御部35、印字制御部36、表示制御部37、メ
モリ制御部38がそれぞれ接続される。上記キー
制御部35はキーボード11と接続され、キーサ
ンプリング信号を送出し、キー操作信号が入力さ
れる。また、上記印字制御部36はプリンタ13
と接続され、印字動作を制御する回路である。 FIG. 2 shows a detailed configuration of the CPU 12 in FIG. 1. In the figure, numeral 31 is a ROM (read-only memory) in which various microprograms are stored, and this microprogram is sent to a control section 32 where its instructions are decoded. This control section 32 controls the entire system, and outputs various control commands, address designation signals, chip designation signals, etc. Control unit 32 and calculation unit 3
Arithmetic data and arithmetic control signals are transmitted and received between the three, and various arithmetic operations are executed. In addition, this control section 3
2 receives the RESTART signal from the WAIT control section 26. This RESTART signal is a signal for restarting the stopped operation of the CPU 12.
Reference numeral 34 is an internal memory having X, Y, Z, and A to E registers, which holds calculation data, display data, set number data, etc., and transmits and receives data and address information to and from the control section 32. Further, a key control section 35, a print control section 36, a display control section 37, and a memory control section 38 are connected to the control section 32, respectively. The key control section 35 is connected to the keyboard 11, sends out key sampling signals, and receives key operation signals. Further, the print control section 36 is connected to the printer 13.
This circuit is connected to the printer and controls printing operations.
上記表示制御部37に表示ドライバ14と接続
され、前記メモリ内の表示用Xレジスタの内容が
送られてくるもので、この表示制御部37は入力
される表示データをコード変換して表示ドライバ
14に送出する。また、メモリ制御部38は
ANSメモリ16、データメモリ21、プログラ
ムメモリ23等のアドレス指定とデータの送受を
行なう回路である。 The display control unit 37 is connected to the display driver 14 and receives the contents of the display X register in the memory.The display control unit 37 converts the input display data into codes and sends them to the display driver 14. Send to. In addition, the memory control unit 38
This circuit specifies addresses of the ANS memory 16, data memory 21, program memory 23, etc. and sends and receives data.
ここで、システム全体の動作の概略を説明す
る。キーボード11から入力されたプログラム
は、CPU12を介してプログラムメモリ23に
書込まれる。この際、変数エリアはデータメモリ
21内に確保される。しかして、変数には単なる
数値変数、1次元配列、2次元配列がありそれぞ
れデータメモリ21の使い方が異なるので、配列
判定回路20によつて定義された配列を判定す
る。この判定結果を利用することによつて、2次
元配列の形で書込んだデータを1次元配列で読出
すことも可能となる。また、変数はA$〜Z$、
A0$〜Z9$及び$を文字変数として使用でき、
各々最大7文字であるが、$については最大30文
字まで割当てることができ、その変数は文字メモ
リ22に記憶される。 Here, an outline of the operation of the entire system will be explained. A program input from the keyboard 11 is written into the program memory 23 via the CPU 12. At this time, a variable area is secured within the data memory 21. Since the variables include simple numerical variables, one-dimensional arrays, and two-dimensional arrays, and the usage of the data memory 21 is different for each variable, the array determining circuit 20 determines the defined array. By using this determination result, data written in a two-dimensional array can also be read out in a one-dimensional array. Also, the variables are A$~Z$,
A0$~Z9$ and $ can be used as character variables,
Each variable has a maximum of 7 characters, but up to 30 characters can be assigned for $, and the variable is stored in character memory 22.
次に、プログラム実行の際あるいはマニユアル
計算実行の際は、プログラムメモリ23及びデー
タメモリ21から読出されたデータ、あるいはキ
ーボード11から入力されたデータがCPU12
において演算されるが、演算結果は次の演算結果
が得られるまでANSメモリ16に一時保持され
る。この保持された演算結果の符号はANS符号
判定回路17によつて判定され、結果が負であり
その結果に続けて計算式が入力された場合には、
自動的にその負の数値を括弧で括つて表示する機
能を備えている。また、WAIT命令を実行した
際には、WAIT命令に付加されているコードを
WAITメモリ25に書込み、表示命令(PRINT
命令)を実行した際にWAIT制御部26が動作
して上記コードに対応する時間だけ表示を保持す
る。 Next, when executing a program or performing manual calculation, data read from the program memory 23 and data memory 21 or data input from the keyboard 11 is sent to the CPU 12.
The calculation result is temporarily held in the ANS memory 16 until the next calculation result is obtained. The sign of this retained calculation result is determined by the ANS sign determination circuit 17, and if the result is negative and a calculation formula is input following that result,
It has a function that automatically displays negative numbers in parentheses. Also, when executing the WAIT instruction, the code added to the WAIT instruction is
Write to WAIT memory 25 and display command (PRINT
When the command) is executed, the WAIT control unit 26 operates and holds the display for a period of time corresponding to the above code.
一方、統計演算を行なう際にはデータxiのみ、
あるいはデータxiとデータyiをキーボード11か
ら入力すると、メモリ19に一時保持された後、
統計データ制御部24に書込まれるが、1次デー
タが入力された2次データが入力されたかをSD,
LR判定回路18が自動判別する。そして、デー
タxのみの表示かデータx及びyの両方を表示か
の制御と、データ追加かデータ削除かの区別表示
の制御を行なう。また、統計データ制御部24内
に基本統計データとして度数、データxの総和、
データyの総和、データxの二乗和、データyの
二乗和、データxとyの積和を記憶しているが、
これらの各データを自動的に順番に表示していく
機能を備えている。 On the other hand, when performing statistical calculations, only the data x i ,
Alternatively, when data x i and data y i are input from the keyboard 11, they are temporarily stored in the memory 19 and then
It is written to the statistical data control unit 24, but the SD,
The LR determination circuit 18 automatically determines. Then, it controls whether only data x or both data x and y are displayed, and whether data is added or deleted. In addition, the statistical data control unit 24 contains basic statistical data such as the frequency, the sum of data x,
It stores the sum of data y, the sum of squares of data x, the sum of squares of data y, and the sum of products of data x and y.
It has a function that automatically displays each of these data in sequence.
第3図は第1図におけるANSメモリ16及び
ANS符号判定回路17の詳細な構成を示す図で
ある。図において、16はANSメモリで、CPU
12より読出し/書込み信号R/Wが入力され
る。このANSメモリ16の最下位桁はフラグ領
域として用いられるもので、このANSメモリ1
6に負数データが記憶されると、信号ラインaを
介して“1”信号をフリツプフロツプ41のD端
子に出力する。このフリツプフロツプ41のクロ
ツク端子CPにはCPU12から判定要求信号bが
入力される。また、このフリツプフロツプ41の
Q出力は判定信号cをCPU12に送出する。こ
のANS符号判定回路17には他にフリツプフロ
ツプ42を有しており、ANSフラグとして用い
られる。このフリツプフロツプ42にはCPU1
2からリセツト信号d、セツト信号eが入力され
ており、そのQ出力は信号fとして上記CPU1
2に送出される。 Figure 3 shows the ANS memory 16 and
2 is a diagram showing a detailed configuration of an ANS code determination circuit 17. FIG. In the figure, 16 is ANS memory and CPU
A read/write signal R/W is input from 12. The lowest digit of this ANS memory 16 is used as a flag area, and this ANS memory 1
When negative data is stored in the flip-flop 41, a "1" signal is output to the D terminal of the flip-flop 41 via the signal line a. A determination request signal b is input from the CPU 12 to the clock terminal CP of the flip-flop 41. Further, the Q output of the flip-flop 41 sends a judgment signal c to the CPU 12. This ANS code determination circuit 17 also has a flip-flop 42, which is used as an ANS flag. This flip-flop 42 has a CPU 1
A reset signal d and a set signal e are input from the CPU 2, and the Q output is sent to the CPU 1 as a signal f.
2.
次に、上記のように構成されたこの発明の動作
を説明する。今例えば第1図のプログラムメモリ
23に上記に示すようなプログラムが格納されて
いる場合を例にとり説明する。 Next, the operation of the present invention configured as described above will be explained. Now, an explanation will be given taking as an example a case where a program as shown above is stored in the program memory 23 of FIG. 1.
10PRINT“A=”;SIN(30)
20END
今、10番のステートメントが実行されると
ROM31に記憶されている第4図に示すような
PRINT文を処理するマイクロプログラムが開始
される。まず、ステツプS1においてプログラムメ
モリ23に記憶されている10番のステートメント
の1バイト、つまり「”」がCレジスタの0ない
し1桁目(C0〜1)に読込まれる。そして、ステツ
プS2に進みC0〜1の内容が数字か否か判定される。
この場合には「NO」と判定されてステツプS3に
進む。このステツプS3において、C0〜1の内容が
“,”か否か判定される。この場合には「NO」と
判定されてステツプS4に進む。このステツプS4に
おいてC0〜1が数値関数か否か判定される。この場
合「NO」と判定されてステツプS5に進む。この
ステツプS5において、C0〜1の内容が数値変数か否
か判定される。この場合は「NO」と判定されて
ステツプS6において文字式の値つまり「A=」が
Xレジスタの0〜15桁目(X0〜15)に送られる。
そして、ステツプS7においてX0〜15の内容が表示
制御部37に送られ表示される。さらに、ステツ
プS8に進みCPU12から送出されるLoad信号の
出力が停止されるが、この場合はLoad信号は出
力されていないので変化はない。次に、ステツプ
S9に進みプログラムメモリ23に記憶されている
次の1バイト「;」がC0〜1に読み込まれる。そし
て、ステツプS10において、その内容が「;」か
否か判定される。この場合「YES」と判定され
て前記ステツプS1に戻る。そして、このステツプ
S1において、プログラムメモリ23に記憶されて
いる次の1バイト「SIN(30)」がC0〜1に読込まれ
る。そして、ステツプS2に進みC0〜1の内容が数字
か否か判定される。この場合には「NO」と判定
されてステツプS3に進む。このステツプS3におい
て、C0〜1の内容が“・”か否か判定される。この
場合、「NO」と判定されてステツプS4に進む。
このステツプS4において、C0〜1が数値関数か否か
判定される。この場合、SIN(30)は数値関数で
あるので「YES」と判定されてステツプS11に進
む。このステツプS11において数式の値「0.5」が
X0〜15に送られる。次にステツプS12において
Load信号がANSメモリ16に出力される。即
ち、R/W信号が書込みモードとなり、次のステ
ツプS7でX0〜15の内容がANSメモリ16及び表示
制御部37に送出される。次に、ステツプS8に進
み上記Load信号の送出は停止される。そして、
ステツプS9においてプログラムメモリ23に記憶
されている次の1バイトがC0〜1に読み込まれる。
この場合、次の1バイトには「;」は記憶されて
いないため、「NO」と判定されてPRINT文の処
理は終了する。 10PRINT“A=”;SIN(30) 20END Now, when statement number 10 is executed
As shown in Fig. 4 stored in ROM31
A microprogram that processes PRINT statements is started. First, in step S1 , one byte of the tenth statement stored in the program memory 23, ie, "", is read into digits 0 to 1 ( C0-1 ) of the C register. Then, the process proceeds to step S2 , and it is determined whether the contents of C0-1 are numbers.
In this case, the determination is "NO" and the process proceeds to step S3 . In this step S3 , it is determined whether the contents of C0-1 are "," or not. In this case, the determination is "NO" and the process proceeds to step S4 . In this step S4 , it is determined whether C0-1 is a numerical function or not. In this case, the determination is "NO" and the process proceeds to step S5 . In step S5 , it is determined whether the contents of C0-1 are numerical variables. In this case, the determination is ``NO'', and in step S6 , the value of the character expression, ie, ``A='' is sent to the 0th to 15th digits (X 0 to 15 ) of the X register.
Then, in step S7 , the contents of X0 to X15 are sent to the display control section 37 and displayed. Furthermore, the process proceeds to step S8 , and the output of the Load signal sent from the CPU 12 is stopped, but in this case, there is no change since the Load signal is not output. Next, step
Proceeding to S9 , the next 1 byte ";" stored in the program memory 23 is read into C0-1 . Then, in step S10 , it is determined whether the content is ";". In this case, the determination is ``YES'' and the process returns to step S1 . And this step
At S1 , the next 1 byte "SIN (30)" stored in the program memory 23 is read into C0-1 . Then, the process proceeds to step S2 , and it is determined whether the contents of C0-1 are numbers. In this case, the determination is "NO" and the process proceeds to step S3 . In this step S3 , it is determined whether the contents of C0-1 are ".". In this case, the determination is "NO" and the process proceeds to step S4 .
In this step S4 , it is determined whether C0-1 is a numerical function or not. In this case, since SIN(30) is a numerical function, it is determined as "YES" and the process proceeds to step S11 . In this step S11 , the value of the formula "0.5" is
Sent to X 0-15 . Next, in step S12
A Load signal is output to the ANS memory 16. That is, the R/W signal becomes the write mode, and the contents of X0 to X15 are sent to the ANS memory 16 and the display control section 37 in the next step S7 . Next, the process proceeds to step S8 , and the sending of the Load signal is stopped. and,
In step S9 , the next byte stored in the program memory 23 is read into C0-1 .
In this case, since ";" is not stored in the next byte, the determination is "NO" and the processing of the PRINT statement ends.
ところで、上記ANSメモリ16に記憶される
数値データを表示装置15に表示させる場合には
キーボード11の「ANS」キーを操作する。こ
の操作によりCPU12よりANSメモリ16に
Read信号が出力されて、即ちR/W信号が読み
出しモードとなりANSメモリ16の内容「0.5」
がXレジスタに読み出される。そして、CPU1
2よりANSメモリ16へRead信号の送出が停止
される。さらに、Xレジスタの内容「0.5」が表
示制御部37に送られ表示装置15に「0.5」が
表示される。このように「ANS」キーを操作す
ることによりANSメモリ16の内容が表示装置
15に表示され、以下、その内容を被演算数とし
て演算を続行することができる。 By the way, when displaying the numerical data stored in the ANS memory 16 on the display device 15, the "ANS" key on the keyboard 11 is operated. This operation moves the CPU 12 to the ANS memory 16.
The Read signal is output, that is, the R/W signal becomes the read mode, and the content of the ANS memory 16 is "0.5".
is read into the X register. And CPU1
2, the sending of the Read signal to the ANS memory 16 is stopped. Further, the content "0.5" of the X register is sent to the display control section 37 and "0.5" is displayed on the display device 15. By operating the "ANS" key in this manner, the contents of the ANS memory 16 are displayed on the display device 15, and subsequent calculations can be continued using the contents as the operand.
一方、上記ANSメモリ16に記憶されている
データをプログラム中、あるいはマニユアル計算
の式の途中で使用する場合は、当該式を「ANS」
キーを用いて、例えば
B=COS(ANS)×π(ここで、ANSは
「ANS」キーの操作に応じて入力された命令)の
ように作成する。しかして、CPU12がこのス
テートメントを実行する際にANS命令を解読す
ると、上述した「ANS」キーを操作したときの
処理と同様の処理が行なわれ、例えば
B=COS(0.5)×π
と等価の演算を行なうことができる。 On the other hand, when using the data stored in the ANS memory 16 in a program or in the middle of a manual calculation formula, the formula is
For example, B=COS(ANS)×π (where ANS is the command input in response to the operation of the “ANS” key) using the key. Therefore, when the CPU 12 decodes the ANS instruction when executing this statement, the same processing as that when operating the "ANS" key described above will be performed, for example, B = COS (0.5) × π. Can perform calculations.
以上詳述したようにこの発明によれば、プログ
ラム付小型電子計算機においてプログラム中で表
示/印字された数値データを記憶するメモリを設
け、特定キー操作によりその内容を読み出してマ
ニユアル演算することができる。更に、特定キー
を用いて計算式あるいはプログラムを書くことが
できるから、プログラム中の演算式の演算結果に
対し、個々にその演算結果を記憶する変数名を設
定することなく、一旦表示/印字したデータを次
の計算に使用することができ、しかも、特定キー
の操作により読出されるデータが負の場合にあつ
ては、そのデータを括弧で括つて表示するため
に、特定キーによつて読出されるデータが正であ
るか負であるかを考慮することなく計算式を設定
でき、しかもその計算式を見易くすることができ
る等、きわめて便利なものである。 As detailed above, according to the present invention, a small computer with a program is provided with a memory for storing numerical data displayed/printed in a program, and the contents can be read out and manually calculated by operating a specific key. . Furthermore, since calculation formulas or programs can be written using specific keys, the calculation results of calculation formulas in a program can be displayed/printed once without setting variable names to store the calculation results individually. The data can be used for the next calculation, and if the data read by operating a specific key is negative, the data can be read by the specific key in order to be displayed in parentheses. This is extremely convenient because it allows you to set a calculation formula without considering whether the data to be calculated is positive or negative, and it also allows you to make the calculation formula easier to read.
図面はこの発明の一実施例を示すもので、第1
図は本発明を適用した小型電子計算機の全体のブ
ロツク図、第2図は第1図におけるCPU12の
詳細な構成を示す図、第3図は第1図における
ANSメモリ及びANS符号判定回路の詳細な構成
を示す図、第4図は動作を示すフローチヤートで
ある。
11…キーボード、12…CPU、16…ANS
メモリ、17…ANS符号判定回路、21…デー
タメモリ、23…プログラムメモリ。
The drawings show one embodiment of the invention.
The figure is an overall block diagram of a small computer to which the present invention is applied, FIG. 2 is a diagram showing the detailed configuration of the CPU 12 in FIG. 1, and FIG.
FIG. 4 is a diagram showing the detailed configuration of the ANS memory and the ANS code determination circuit, and is a flowchart showing the operation. 11...Keyboard, 12...CPU, 16...ANS
Memory, 17...ANS code determination circuit, 21...Data memory, 23...Program memory.
Claims (1)
ることによりデータを表示/印字するプログラム
付小型電子計算機において、上記表示/プリント
命令により表示/印字データを保持するメモリ
と、キーボードに設けられた特定キーと、この特
定キーによるキー入力信号もしくは上記特定キー
の操作に応じてプログラム上に入力されたデータ
を上記表示/プリント命令により上記メモリに保
持されたデータの変数名入力として処理する処理
手段と、この処理手段により上記特定キーによる
キー入力信号もしくはプログラム実行中に読出さ
れたプログラム中の上記特定キーに応じたデータ
が変数名入力として処理された際上記メモリに記
憶されているデータを読出す読出し手段と、上記
メモリに記憶されているデータの正負を判定する
符号判定手段と、上記読出し手段により上記メモ
リから読み出されたデータを表示する際該データ
が上記符号判定手段により負であると判定された
場合に当該データを括弧で括つて表示する手段と
を具備したことを特徴とするプログラム付小型電
子計算機。1. In a small electronic computer with a program that displays/prints data by executing display/print commands in the program, a memory that holds display/print data according to the display/print commands, a specific key provided on the keyboard, and , processing means for processing data input on the program in response to a key input signal from the specific key or an operation of the specific key as input of a variable name of data held in the memory by the display/print command; reading means for reading data stored in the memory when a key input signal from the specific key or data corresponding to the specific key in the program read during program execution is processed as a variable name input by the processing device; and a sign determining means for determining whether the data stored in the memory is positive or negative, and when displaying the data read from the memory by the reading means, the data is determined to be negative by the sign determining means. 1. A small electronic computer with a program, characterized in that the computer is equipped with means for displaying the data in parentheses when the data is displayed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP56070959A JPS57185562A (en) | 1981-05-12 | 1981-05-12 | Small-sized electronic calculator with program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP56070959A JPS57185562A (en) | 1981-05-12 | 1981-05-12 | Small-sized electronic calculator with program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS57185562A JPS57185562A (en) | 1982-11-15 |
| JPH0321939B2 true JPH0321939B2 (en) | 1991-03-25 |
Family
ID=13446559
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP56070959A Granted JPS57185562A (en) | 1981-05-12 | 1981-05-12 | Small-sized electronic calculator with program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS57185562A (en) |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CA1028427A (en) * | 1973-05-29 | 1978-03-21 | Peter D. Dickinson | Scientific calculator |
-
1981
- 1981-05-12 JP JP56070959A patent/JPS57185562A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS57185562A (en) | 1982-11-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPS5856143B2 (en) | Terminal device test program startup method | |
| JPH0321939B2 (en) | ||
| JPH0241060B2 (en) | PUROGURAMUTSUKIKOGATADENSHIKEISANKI | |
| JPH0327944B2 (en) | ||
| JPH0241061B2 (en) | TOKEIENZANKINOOSONAETAKOGATADENSHIKEISANKI | |
| JPH0245210B2 (en) | PUROGURAMUTSUKIKOGATADENSHIKEISANKI | |
| JPS6239465B2 (en) | ||
| JP4083870B2 (en) | Product processing equipment | |
| JPS5938870A (en) | Electronic computer | |
| JPH021627Y2 (en) | ||
| JPH01158556A (en) | Device for setting operational mode of electronic calculator | |
| JPH0555248U (en) | Small electronic calculator | |
| JPS642180Y2 (en) | ||
| JPS6227930Y2 (en) | ||
| JPH0610434Y2 (en) | Small electronic calculator | |
| JPS6336529B2 (en) | ||
| JPH086754A (en) | Data display | |
| JPH0160873B2 (en) | ||
| JPH03161828A (en) | printer control device | |
| JPS6128144A (en) | Executing device of tracing | |
| JPH0420217B2 (en) | ||
| JPS6227420B2 (en) | ||
| JPH04216982A (en) | Printing of page numbers | |
| JPH0155496B2 (en) | ||
| JPS63146157A (en) | Document processor |