JPS5837582B2 - program protection device - Google Patents
program protection deviceInfo
- Publication number
- JPS5837582B2 JPS5837582B2 JP52159709A JP15970977A JPS5837582B2 JP S5837582 B2 JPS5837582 B2 JP S5837582B2 JP 52159709 A JP52159709 A JP 52159709A JP 15970977 A JP15970977 A JP 15970977A JP S5837582 B2 JPS5837582 B2 JP S5837582B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- register
- address
- data
- storage device
- 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
Links
Landscapes
- Storage Device Security (AREA)
Description
【発明の詳細な説明】
本発明はプログラムの書込みおよび消去ならびにマニュ
アル計算をなし得る電子計算機に係り、特に書込まれた
プログラムの保護を行うプログラム保護装置に関する。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an electronic computer capable of writing and erasing programs and performing manual calculations, and more particularly to a program protection device that protects written programs.
従来、プログラムを記憶しこれに従って作業を進めてい
くストアードブログラム方式の電子計算機であって、プ
ログラムの書込みおよび消去ならびにマニュアル計算(
この明細書においてマニュアル計算とは四則計算のほか
関数計算を含めたものをいう)を行う機能を有する電子
計算機は、マニュアル計算を行う際にはまず、例えばP
RINT等の何らかのコマンドを入力してから行うよう
になっており、コマンドを入力させないでマニュアル計
算を行ってしまうと前に書込まれたプログラムを消去し
てしまうおそれがある。Conventionally, it is a stored program electronic computer that memorizes a program and proceeds with the work according to it.
In this specification, an electronic computer that has the function of performing manual calculations (including functional calculations in addition to the four arithmetic calculations) must first perform, for example, P
The calculation is performed after inputting some command such as RINT, and if manual calculation is performed without inputting the command, there is a risk that the previously written program will be erased.
例えば、BASIC言語を使用した次のようなプログラ
ムが書込まれているときに、
既に書込まれている行番号10のみを入力させて実行キ
ーを押すと、行番号10のステートメントがすべて消去
されてしまうという問題点がある。For example, when the following program using BASIC language is written, if you input only line number 10, which has already been written, and press the execute key, all the statements on line number 10 will be deleted. There is a problem with this.
本発明は、従来のこのような問題点を解決するためにな
されたもので、マニュアル計算時に、例えば上述のよう
なコマンドを与えなくても既に書込まれたプログラムが
消去されることのない、換言すれば既に書込まれたプロ
グラムに影警を与えることなくマニュrル計算をなし得
るプログラム保護装置を提供することを目的とする。The present invention has been made to solve these conventional problems, and it is possible to prevent already written programs from being erased even if the above-mentioned command is not given during manual calculation. In other words, it is an object of the present invention to provide a program protection device that can perform manual calculations without affecting already written programs.
この目的を達或するために、本発明は、書込まれたある
いはこれから書き込まれるプログラムを消去可能とする
か消去不可能とするかを選択する選択手段と、この選択
手段の選択内容を記瞳する記憶装置とを備え、前記記憶
装置がプログラムの消去を不可能とすべきことを記憶し
ているときには入力データをマニュアル計算用データと
みなしてプログラムの記憶を保持するように制御するも
のである。In order to achieve this object, the present invention provides a selection means for selecting whether a program that has been written or will be written in the future is erasable or non-erasable, and a method for recording the selection contents of the selection means. and a storage device that stores the program, and when the storage device stores that the program should not be erased, the input data is regarded as manual calculation data and the program is controlled to be retained. .
以下、添付図面を参照して本発明の実施例を説明する。Embodiments of the present invention will be described below with reference to the accompanying drawings.
第1図および第2図は本発明によるパーソナルコンピュ
ータの一実施例を示す斜視図およびブロック図である。1 and 2 are a perspective view and a block diagram showing an embodiment of a personal computer according to the present invention.
パーソナルコンピュータ1は、基本的に16ビットのマ
イクロコンピュータであり、主記憶装置2、中央処理装
置3、キーボード部4、CRT表示部5をそなえている
。The personal computer 1 is basically a 16-bit microcomputer, and includes a main storage device 2, a central processing unit 3, a keyboard section 4, and a CRT display section 5.
主記憶装置2は、システム領域8とユーザー領域10と
に分かれている。The main storage device 2 is divided into a system area 8 and a user area 10.
システム領域8は、システムプログラム記憶領域12と
、ユーザープログラム先頭アドレス記憶領域14と、シ
ステムワーキングレジスタ群16と、システムワーキン
グ領域18とからなっている。The system area 8 includes a system program storage area 12, a user program start address storage area 14, a system working register group 16, and a system working area 18.
システムプログラム記憶領域12は、例えばコマンド参
照テーブル、割込処理プログラム、エラー処理プログラ
ム、各種演算用プログラム等ハードウエアを制御する固
定プログラムを記憶するものである。The system program storage area 12 stores fixed programs that control hardware, such as command reference tables, interrupt processing programs, error processing programs, and various calculation programs.
ユーザーズプログラム先頭アドレス記憶領域14は、ユ
ーザーが書込んだプログラムの先頭アドレスを記憶する
ものである。The user's program start address storage area 14 stores the start address of the program written by the user.
システムワーキングレジスタ群16はシステムが使用す
る変数を一次記憶するためのレジスタR1〜R12から
なっている。The system working register group 16 consists of registers R1 to R12 for temporarily storing variables used by the system.
システムワーキング領域18は上記以外の各種情報を記
憶するもので、この中にはユーザにより書込まれるプロ
グラムを消去不可能(以下ロック状態という)とするか
消去可能(以下、解除状態という)とするかを選択する
プログラム保護キー20(第1図および第2図のキーボ
ード部4参照)の状態を記憶するプロテクトレジスタa
1が設けられている。The system working area 18 stores various information other than the above, and includes information on whether a program written by the user is non-erasable (hereinafter referred to as locked state) or erasable (hereinafter referred to as unlocked state). A protect register a stores the state of the program protection key 20 (see keyboard section 4 in FIGS. 1 and 2) for selecting the
1 is provided.
プロテクトレジスタa1は例えば第3図に示すように5
200(16進数)番地に配置される16ビットのレジ
スタであり、プログラム保護キー20がロック状態にあ
ると第4a図に示すように内容が1010101010
101010となり、プログラム保護キー20が解除状
態にあると第4b図に示すように内容が0101010
101010101となるものである。For example, the protect register a1 is 5 as shown in FIG.
It is a 16-bit register located at address 200 (hexadecimal number), and when the program protection key 20 is in the locked state, the contents are 1010101010 as shown in FIG. 4a.
101010, and when the program protection key 20 is in the released state, the content becomes 0101010 as shown in FIG. 4b.
101010101.
換言すれば、プログラム保護キー20がロック状態にあ
るとプロテクトレジスタa1のMSDは1となり、プロ
グラム保護ギー20が解除状態にあるとプロテクトレジ
スタa1のMSDがOとなるようになっている。In other words, when the program protection key 20 is in the locked state, the MSD of the protect register a1 is 1, and when the program protection key 20 is in the released state, the MSD of the protect register a1 is O.
なお、この実施例では、ワーキングレジスタR1の番地
を5101番地、ワーキングレジスタR2の番地を51
02番地としている。In this embodiment, the address of working register R1 is 5101, and the address of working register R2 is 51.
The address is 02.
主記憶装置2のユーザー領域10は、行番号テーブル2
2と、ソースプログラム領域24と、変数テーフル26
と、ユーザーワーキング領域28とからなっている。The user area 10 of the main storage device 2 has a row number table 2
2, source program area 24, and variable table 26
and a user working area 28.
行番号テーブル22は、ユーザーにより書込まれた行番
号及びステートメントから成るプログラム情報の行番号
と、このステートメントが記憶されている番地とを対に
して記憶するものであり、ソースプログラム領域24は
ユーザーにより書き込まれたステートメントを記憶する
ものである。The line number table 22 stores a pair of line numbers of program information consisting of line numbers and statements written by the user and addresses where these statements are stored, and the source program area 24 is It stores the statements written by.
中央処理装置3中の制御部30は、インストラクション
レジスタ、リードオンリーメモリ(ROM)、およびイ
ンストラクションデコーダ等をそなえている。The control unit 30 in the central processing unit 3 includes an instruction register, a read-only memory (ROM), an instruction decoder, and the like.
ROMは中央処理装置3の内外の論理回路を制御するマ
イクロプログラムが記憶されており、インストラクショ
ンレジスタは主記憶装置2からデータバス32を介して
読出される命令が格納されるもので、この出力により上
記ROMに記憶されているマイクロプログラムを選択的
に出力させるものである。The ROM stores a microprogram that controls the internal and external logic circuits of the central processing unit 3, and the instruction register stores instructions read from the main memory 2 via the data bus 32. The microprogram stored in the ROM is selectively output.
イラストラクションデコーダは上記ROMの出力を解読
して、マルチプレクサ44等に接続されているコントロ
ールバス34に制御信号を出力し且つ主記憶装置2に接
続されているコントロールバス35に制御信号を出力す
るとともに、主記憶装置2に接続されているイネーブル
ライン36にイネーブル信号MEを出力するか、あるい
はキーボード部4およびCRT表示部5に接続されてい
る入力/出力(以下I/Oと略記する)イネーブルライ
ン38にメモリデイセイブル信号(以後単にデイセイブ
ル信号と略記する)MEを出力することにより中央処理
装置3内外の装置の制御を行うものであり、上記2つの
信号MEとMEは二者択一的に出力される。The illustration decoder decodes the output of the ROM, outputs a control signal to the control bus 34 connected to the multiplexer 44, etc., and outputs a control signal to the control bus 35 connected to the main storage device 2. , outputs the enable signal ME to the enable line 36 connected to the main storage device 2, or input/output (hereinafter abbreviated as I/O) enable line connected to the keyboard section 4 and CRT display section 5. It controls devices inside and outside the central processing unit 3 by outputting a memory disable signal (hereinafter simply abbreviated as a disable signal) ME to 38, and the above two signals ME and ME can be used as an alternative. Output.
インクラフ゜トレジスタ40はキイーボード部4等の外
部入出力装置からの割込み要求信号(シリアル信号)を
受けて、その割込みレベルをパラレルに記憶するもので
あり、また、イニシャルセット回路42から電源投入時
の割込要求信号も受けるようになっている。The incraft register 40 receives an interrupt request signal (serial signal) from an external input/output device such as the keyboard section 4, and stores the interrupt level in parallel. It also receives interrupt request signals.
マルチプレクサ44は、インクラブトレジスタ40から
の割込みレベルを示す信号、制御部30からの制御信号
、主記憶装置2からデータバス32を介して与えられる
信号、および後述のデータバツファ50から与えられる
データ信号を選択してレジスタ群48の所定のレジスタ
または演算論理ユニット(以下ALUと略記する)46
に与えるものである。The multiplexer 44 receives a signal indicating an interrupt level from the increment register 40, a control signal from the control unit 30, a signal provided from the main storage device 2 via the data bus 32, and a data buffer 50, which will be described later. A data signal is selected and a predetermined register of the register group 48 or an arithmetic logic unit (hereinafter abbreviated as ALU) 46 is selected.
It is given to
ALU46は制御部30から与えられる制御信号に基き
、データの加算、減算、この繰返しによる乗算、除算、
シフト、および回転等を行うものである。Based on the control signal given from the control unit 30, the ALU 46 performs data addition, subtraction, multiplication and division by repeating this process,
It performs shifting, rotation, etc.
レジスタ群48中には、2つの1次記憶レジスタTA,
TB、プログラムカウンタPC,ワーキングポインタW
P,およびステータスレジスタSTが設けられている,
プログラムカウンタPCは主記憶装置2中に記憶されて
いるシステムプログラムのアドレスを指定するものであ
る。The register group 48 includes two primary storage registers TA,
TB, program counter PC, working pointer W
P, and a status register ST are provided.
The program counter PC specifies the address of the system program stored in the main storage device 2.
ワーキングポインタWPはシステムプログラムにより使
用されるワーキングレジスタR1乃至R12の先頭アド
レスを記憶するものである。The working pointer WP stores the start address of the working registers R1 to R12 used by the system program.
ステータスレジスタSTはプログラムの実行、演算等の
各種状態を保持するレジスタであり、プログラムキーの
状態用ビット、各レベルの割込みマスク用ビット、オー
バーフロー表示用ビット、キャリー表示用ビット等を有
している。The status register ST is a register that holds various states such as program execution and calculation, and has bits for program key status, interrupt mask bits for each level, overflow display bit, carry display bit, etc. .
データバツファ50はデータバス32を介して主記憶装
置2に接続されるとともに、バス60等を介してマルチ
プレクサ44とALU45に接続され、中央処理装置3
の内部(マルチプレクサ44、ALU46等)に対して
は双方向性を有し、主記憶装置2に対しては出力のみを
与えるバツファレジスタであり、中央処理装置3から主
記憶装置2に向うデータは一旦このデータバツファ50
に記憶された後出力される。The data buffer 50 is connected to the main storage device 2 via a data bus 32, and is also connected to the multiplexer 44 and ALU 45 via a bus 60, etc., and is connected to the central processing unit 3.
It is a buffer register that has bidirectionality for the internal parts (multiplexer 44, ALU 46, etc.) and provides only output to the main storage device 2, and is a buffer register that outputs data from the central processing unit 3 to the main storage device 2. Once this data buffer 50
is stored and then output.
ア“ドレスバツファ52はアドレスバス56を介して主
記憶装置2及び入出力装置(キーボード部4、CRT表
示部5)に接続されるとともにバス60等を介してAL
U46に接続され、ALU46から与えられるアドレス
信号を一時記憶し、このアドレスバス56を介して主記
憶装置2または入出力装置(キーボード部4、CRT表
示部5)に与える7もめである。The address buffer 52 is connected to the main storage device 2 and input/output devices (keyboard section 4, CRT display section 5) via an address bus 56, and is also connected to the AL via a bus 60 etc.
It is connected to U46, temporarily stores the address signal given from ALU46, and gives it to main storage device 2 or input/output device (keyboard section 4, CRT display section 5) via this address bus 56.
入出力バツファ−(以下I/Oバツファと略記する)5
4はデータパス58を介して入出力装置(キーボード部
4とCRT表示部5)に接続されるとともにバス60等
を介してALU46に接続され、入出力装置とALU4
5との間で送受されるデータおよび制御情報←時記憶す
るものである。Input/output buffer (hereinafter abbreviated as I/O buffer) 5
4 is connected to the input/output devices (keyboard section 4 and CRT display section 5) via a data path 58, and is also connected to the ALU 46 via a bus 60 etc., so that the input/output devices and the ALU 4
The data and control information sent and received between the computer and the computer 5 are stored at the time.
キーボード部4は、キーボード本体62と、エンコーダ
64と、入出力ポート(以下I/Oボートと略記する)
66とからなっている。The keyboard unit 4 includes a keyboard body 62, an encoder 64, and an input/output port (hereinafter abbreviated as I/O port).
It consists of 66.
キーボード本体62は、上述のプログラム保護キー20
のほかに、実行キー68、プログラム指定キー69a、
英文字、数字キー69b、スペースキー69c、カーソ
ル移動キー等が配設されるとともに、プログラム保護キ
ー20がロック状態にあるときに点灯しプログラム保護
キー20が解除状態にあるときに消灯されるプログヂム
保護表示ランプTOが設けられている。The keyboard body 62 has the program protection key 20 described above.
In addition to the execution key 68, program specification key 69a,
Alphabet and numeric keys 69b, space key 69c, cursor movement keys, etc. are provided, and the program lights up when the program protection key 20 is in the locked state and turns off when the program protection key 20 is in the released state. A protection indicator lamp TO is provided.
エンコーダ64はキーボード本体62のキーが操作され
ることにより発生する情報をエンコードしてI/Oポー
ト66に与えるとともに、キーが操作されることにより
発生する割込要求信号をインタラプトレジスタ42に与
えるものである。The encoder 64 encodes information generated when keys on the keyboard body 62 are operated and provides the encoded information to the I/O port 66, and also provides an interrupt request signal generated when the keys are operated to the interrupt register 42. It is.
I/Oポート66は、出力用ラッチ回路72、入力用ラ
ッチ回路74、およびデコーダ76とからなっている。The I/O port 66 includes an output latch circuit 72, an input latch circuit 74, and a decoder 76.
出力用ラッチ回路72はエンコーダ64の出力データ←
時保持しデータパス58に与えるものである。The output latch circuit 72 receives the output data of the encoder 64←
It holds the current time and provides it to the data path 58.
入力用ラッチ回路74は中央処理装置3からデータパス
58を介して与えられるデータおよび制御情報を一時保
持してキーボード本体62に与え上記表示ランプ70を
点灯,駆動する゛とともに出力用ラッチ回路72に与え
るものである。The input latch circuit 74 temporarily holds the data and control information given from the central processing unit 3 via the data path 58 and supplies it to the keyboard body 62 to light and drive the display lamp 70 and also to the output latch circuit 72. It is something to give.
デコーダ76はデイセイブルライン38およびアドレス
バス56に接続され、デイセイブル信号MEを受け且つ
中央処理装置3からアドレス指定を受けたときにキーボ
ード部4を作動可能とするものである。The decoder 76 is connected to the disable line 38 and the address bus 56, and enables the keyboard section 4 when it receives the disable signal ME and receives an address designation from the central processing unit 3.
CRT表示部5は例えば80個のキャラクタを24行ま
で表示できるものであり、I/Oポート78と、CRT
記憶装置80と、アドレス制御部82と、駆動制御部8
4と、CRT本体部86とからなっている。The CRT display unit 5 can display up to 24 lines of 80 characters, for example, and has an I/O port 78 and
Storage device 80, address control section 82, and drive control section 8
4 and a CRT main body section 86.
I/Oポート78は、中央処理装置3からデータパス5
8を介して与えられる入カデータおよび制御情報をそれ
ぞれ一時保持する入力データ用ラッチ回路および制御情
報用ラッチ回路と、CRT表示部5側から出力されるデ
ータを一時保持する出力データ用7ラツチ回路と、上記
制御情報用ラッチ回路の出力を解読する解読器と、デイ
セイブルライン38とアドレスノ.くス56に接続され
てデイセイブル信号MEを受け且つ中央処理装置3から
アドレス指定がなされたときにCRT表示部5を作動可
能にするデコーダとをそなえている。The I/O port 78 connects the central processing unit 3 to the data path 5.
an input data latch circuit and a control information latch circuit that temporarily hold the input data and control information provided through the CRT display section 5; and an output data latch circuit that temporarily holds the data output from the CRT display section 5 side. , a decoder for decoding the output of the control information latch circuit, and a disable line 38 and an address no. The decoder is connected to the CRT display section 56 to receive the disable signal ME, and enables the CRT display section 5 when an address is specified from the central processing unit 3.
CRT記憶装置80は、CRT本体86に表示すべきデ
ータが記憶される記憶装置である。The CRT storage device 80 is a storage device in which data to be displayed on the CRT main body 86 is stored.
アドレス制御部82は中央処理装置3から与えられるデ
ータに基きCRT記憶装置80のアドレス指定を行うと
ともにカーソルの位置を制御するものである。The address control section 82 specifies the address of the CRT storage device 80 based on data given from the central processing unit 3 and controls the position of the cursor.
駆動制御部84は、CRT記憶装置80から与えられる
データに対応したキャラクタをドットおよびラスクに合
わせて出力するキャラクタジエネレー夕と、ドットカウ
ンタ、キャラクタカウンタ、ラスタカウンタおよび行カ
ウンタを含み水平同期信号および垂直同期信号を出力す
るCRTカウンタと、パラレルーシリアル変換を行って
ビデオ信号を出力するP/S変換器と、ビデオ信号を増
幅してCRT本体86にデータ表示させるCRTドライ
バ等.とからなっている。The drive control unit 84 includes a character generator that outputs characters corresponding to data provided from the CRT storage device 80 in accordance with dots and rasks, a dot counter, a character counter, a raster counter, and a line counter, and receives a horizontal synchronization signal. and a CRT counter that outputs a vertical synchronization signal, a P/S converter that performs parallel-to-serial conversion and outputs a video signal, and a CRT driver that amplifies the video signal and displays the data on the CRT main body 86. It consists of
なお、第1図中、102は補助記憶装置としての機能を
有するカセットMTであり、このカセットMT 1 0
2を制御するイジエクト釦104a,巻戻し釦104
bがパネル上に設けられている。In addition, in FIG. 1, 102 is a cassette MT having a function as an auxiliary storage device, and this cassette MT 10
Eject button 104a and rewind button 104 that control 2
b is provided on the panel.
また、第2図中、106はクロツク信号発生器でありコ
ンピュータ1全体の同期をとっている。Further, in FIG. 2, 106 is a clock signal generator which synchronizes the entire computer 1.
次に、このように構或された実施例の動作を第5図、第
6a図および第6b図のフローチャートならびに第7a
図および第7b図の状態図を参照して説明する。Next, the operation of the embodiment configured as described above will be described with reference to the flowcharts in FIGS. 5, 6a and 6b, and 7a.
7b and the state diagram of FIG. 7b.
コンピュータ1が始動されると、第6a図および第7a
図に示すようにプログラムカウンタPCが主記憶装置2
のアドレス(m)を指定し、このアドレスに相当するシ
ステムプログラム領域12から“ワーキングレジスタR
1に定数をロードせよ”という2バイト命令が読出され
、この命令が制御部30により解読される。When the computer 1 is started, FIGS. 6a and 7a
As shown in the figure, the program counter PC is in the main memory 2.
Specify the address (m) of "working register R" from the system program area 12 corresponding to this address.
A 2-byte command "Load a constant to 1" is read out, and this command is decoded by the control unit 30.
次に、プログラムカウンタPCのカウント値が、(m+
1)となり、16進数の5555(定数)がレジスタ群
48の一時記憶レジスタTAにロードされる。Next, the count value of the program counter PC is (m+
1), and the hexadecimal number 5555 (constant) is loaded into the temporary storage register TA of the register group 48.
このロードが終了するとワーキングレジスタR1の番地
を得る為ワーキングポインタWPにr+1jL,たアド
レス、即ち5101がアドレスバツファ52にセットさ
れ、一時記憶レシスタTAの記憶内容がアドレスバツフ
ァ52によってアドレス指定されるワーキングレジスタ
R1に転送される。When this loading is completed, in order to obtain the address of the working register R1, the address r+1jL, that is, 5101, added to the working pointer WP is set in the address buffer 52, and the storage contents of the temporary storage register TA are addressed by the address buffer 52. Transferred to working register R1.
従って、このときのワーキングレジスタR1の内容は2
進数で「0101010101010101Jとなる。Therefore, the contents of working register R1 at this time are 2
In base number it becomes "0101010101010101J.
次に、プログラムカウンタPCがインクリメントされて
主記憶装置2のアドレス(m+2)を指定し、このアド
レスに相当するシステムプログラム領域12から゛ワー
キングレジスタR1の内容をプロテクトレジスタa1に
転送せよ”という命令が読み出され、この命令が制御部
30に.より解読される。Next, the program counter PC is incremented to specify the address (m+2) of the main memory 2, and a command to ``transfer the contents of the working register R1 to the protect register a1'' is issued from the system program area 12 corresponding to this address. This instruction is read out and decoded by the control unit 30.
そして、上述したと同様の動作によってワーキングレジ
スタR1のアドレスがアドレスバツファ52にセットさ
れ、このアドレスバッファ52によってアドレス指定さ
れた、ワーキングレジスタR1から一時記憶レジスタT
Aにその内容0101010101010101が転送
される。Then, the address of the working register R1 is set in the address buffer 52 by the same operation as described above, and the address from the working register R1 to the temporary storage register T, which is addressed by the address buffer 52, is set in the address buffer 52.
The content 0101010101010101 is transferred to A.
次に、プログラムカウンタPCのカウント値がインクリ
メントされて(rn+3)となり、プロテクトレジスタ
a1のアドレスが一時記憶レジスタTBにセットされる
。Next, the count value of the program counter PC is incremented to (rn+3), and the address of the protect register a1 is set in the temporary storage register TB.
そして、この一時記憶レジスタTBの内容がアドレスバ
ツファ52にセットされ、プロテクトレジスタa1のア
ドレスが指定されて一時記憶レジスタTAの内容がプロ
テクトレジスタa1に転送される。Then, the contents of the temporary storage register TB are set in the address buffer 52, the address of the protect register a1 is specified, and the contents of the temporary storage register TA are transferred to the protect register a1.
従って、プロテクトレジスタa1の内容は010101
0101010101となり(第4b図の状態)、ユー
ザーにより主記憶装置2のユーザー預域に書き込まれる
プログラムは消去可能となり、プログラム保護表示ラン
プ70が消灯される。Therefore, the contents of protect register a1 are 010101
0101010101 (the state shown in FIG. 4b), the program written by the user in the user storage area of the main storage device 2 can be erased, and the program protection indicator lamp 70 is turned off.
このように始動時に、書込まれるプログラムを消去可能
状態にするのは換言すれば、プログラム保護キー20を
解除状態とするのは、このとき主記憶装置2内にはユー
ザーの使用するプログラムが書き込まれていないからで
ある。In other words, the program to be written is made erasable at startup, and the program protection key 20 is released because the program used by the user is not written in the main storage device 2 at this time. This is because it is not.
次に、キー操作が行われると、エンコーダ64がキーボ
ード本体62から出力された信号を受けて割込要求信号
をインクラブトレジスタ40に加える。Next, when a key operation is performed, the encoder 64 receives the signal output from the keyboard main body 62 and adds an interrupt request signal to the ink print register 40.
このとき、レジスタ群48中のステータスレジスタST
が割込みマスクをかけていないとすると、第5図に示す
ように、システムプログラム領域12から所定の命令が
読出され、中央処理装置3は操作されたキーがプログラ
ム保護キー20か否かを判断し、操作されたキーがプロ
グラム保護キー20であると判断されると第6b図およ
び第7b図に示すような処理が行われる。At this time, the status register ST in the register group 48
Assuming that interrupts are not masked, a predetermined command is read from the system program area 12, and the central processing unit 3 determines whether the operated key is the program protection key 20, as shown in FIG. When it is determined that the operated key is the program protection key 20, processing as shown in FIGS. 6b and 7b is performed.
即ち、操作されたキーがプログラム保護キー20と判断
されると、プログラムカウンタPCのカウント値(n)
に相当するアドレス指定が行われ、主記憶装置2から“
ワーキングレジスタR2にI/Oポート66のアドレス
データをセット”せよという命令が読み出され、この命
令が制御部30により解読される。That is, when it is determined that the operated key is the program protection key 20, the count value (n) of the program counter PC is
The address corresponding to “
A command to set the address data of the I/O port 66 in the working register R2 is read out, and this command is decoded by the control unit 30.
そして、プログラムカウンタPCのカウント値が(n+
1)となるとキーボード部4のI/Oポート66のアド
レスデータ、例えば110(16進数)がレジスタ群4
6の一時記憶レジスタTAにセットされる。Then, the count value of the program counter PC becomes (n+
1), the address data of the I/O port 66 of the keyboard section 4, for example 110 (hexadecimal number), is stored in the register group 4.
6 is set in temporary storage register TA.
次に、ワーキングポインタWpに2を加算した値Wp+
2 (=5 10 2 )がアドレスバツファ52にセ
ットされて、主記憶装置2の5102番地が指定され、
ワーキングレジスタR2に一時記憶レジスタTAの内容
110が転送される。Next, the value Wp+ which is the addition of 2 to the working pointer Wp
2 (=5 10 2 ) is set in the address buffer 52, and address 5102 of the main storage device 2 is designated.
The contents 110 of temporary storage register TA are transferred to working register R2.
次に、プログラムカウンタPCのカウント値がインクリ
メントされて(n+2)になると、主記憶装置2のうち
このカウント値に相当するアドレスを有する部分から、
゛プロテクトレジスタa1の内容をワーキングレジスタ
R1に転送せよ″との命令が読み出される。Next, when the count value of the program counter PC is incremented to (n+2), from the part of the main memory 2 having the address corresponding to this count value,
The command ``Transfer the contents of protect register a1 to working register R1'' is read out.
そして、プログラムカウンタPCのカウント値が(n+
3)になると,一次記憶レジスタTBにプロテクトレジ
スタa1のアドレス5200が与えられ、プロテクトレ
ジスタa1の内容が一時記憶レジスタTAに転送される
。Then, the count value of the program counter PC becomes (n+
3), the address 5200 of the protect register a1 is given to the primary storage register TB, and the contents of the protect register a1 are transferred to the temporary storage register TA.
次いで、ワーキングレジスタR1のアドレス(Wp+1
) (=5 1 0 1 )がアドレスバツファ52
にセットされ、このアドレスバツファ52によってアド
レス指定されるワーキングレジスタR1に一時記憶レジ
スタTAの内容が転送される。Next, the address of working register R1 (Wp+1
) (=5 1 0 1) is the address buffer 52
The contents of the temporary storage register TA are transferred to the working register R1 addressed by the address buffer 52.
従って、このときのワーキングレジスタR1の内容は「
010101010101010101Jとなる。Therefore, the contents of working register R1 at this time are "
010101010101010101J.
次に、プログラムカウンタPCのカウント値が(n+4
)になると、主記憶装置2の(n+4)番地から゛ワー
キングレジスタR1の内容を1ビット循環左シフトせよ
″という命令が読み出され、制御部30にて解読される
。Next, the count value of the program counter PC is (n+4
), an instruction to ``shift the contents of working register R1 to the left by 1 bit'' is read from address (n+4) of main memory 2 and decoded by control unit 30.
次いで、ワーキングポインタWPに「+1」したワーキ
ングレジスタR1のアドレス(Wp+1 ) (=5
1 0 1 )がアドレスバツファ52にセットされ、
ワーキングレジスタR1の内容が一時記憶レジスタTA
に転送される。Next, the address of working register R1 (Wp+1) (=5
1 0 1) is set in the address buffer 52,
The contents of working register R1 are stored in temporary storage register TA.
will be forwarded to.
次いで、ALU46が一時記憶レジスタTAの内容を1
ビット左に循環シフトし、得られたデータを再び一時記
憶レジスタTAに戻す。Next, the ALU 46 saves the contents of the temporary storage register TA to 1.
The bits are circularly shifted to the left and the obtained data is returned to the temporary storage register TA.
そして、プログラムカウンタPCのカウント値が、(
n−1−5 )となると、上述と同様ワーキングポイン
タWpにr+IJL,たワーキングレジスタR1のアド
レス(Wp+1 )がアドレスバツファ52にセットさ
れ、一時記憶レジスタTBの内容がこのアドレスバツフ
ァ52によりアドレス指定されたワーキングレジスタR
1に転送される。Then, the count value of the program counter PC is (
n-1-5), the address (Wp+1) of the working register R1, which is r+IJL, in the working pointer Wp, is set in the address buffer 52, and the contents of the temporary storage register TB are transferred to the address by this address buffer 52, as described above. specified working register R
Transferred to 1.
従って、このときのワーキングレジスタR1の内容は「
1010101010101010」となる。Therefore, the contents of working register R1 at this time are "
1010101010101010".
次に、プログラムカウンタPCの値が(n+6)になる
と、主記憶装置2のアドレス(n+6)を有する部分か
ら゛ワーキングレジスタR1の内容をプロテクトレジス
タa1に転送せよ″という命令が読み出されて、この命
令が制御部30にて解読され、アドレスバツファ52に
はワーキングレジスタR1のアドレス(Wp+1 )が
上述と同様の動作によりセットされる。Next, when the value of the program counter PC reaches (n+6), the command ``Transfer the contents of the working register R1 to the protect register a1'' is read from the part of the main memory 2 having the address (n+6). This instruction is decoded by the control section 30, and the address (Wp+1) of the working register R1 is set in the address buffer 52 by the same operation as described above.
しかして、次にアドレスバツファ52のアドレス指定に
よりワーキングレジスタR1の内容が一時記憶レジスタ
TAに転送される。Then, by addressing the address buffer 52, the contents of the working register R1 are transferred to the temporary storage register TA.
次いで、プログラムカウンタPCのカウント値が(n+
7)になると、プロテクトレジスタa1のアドレス(5
200番地)が一時記憶レジスタTBに与えられ、一時
記憶レジスタTAの内容が一時記憶レジスタTBの内容
によってアドレス指定されるプロテクトレジスタa1に
転送゛される。Next, the count value of the program counter PC becomes (n+
7), the address of protect register a1 (5
200) is given to the temporary storage register TB, and the contents of the temporary storage register TA are transferred to the protect register a1 addressed by the contents of the temporary storage register TB.
従って、このときのプロテクトレジスタa1の内容は「
1010101010101010Jとなり、主記憶装
置2のユーザー領域に書き込まれたプログラムあるいは
これから書き込まれるプログラムは消去不町能となる。Therefore, the contents of protect register a1 at this time are "
1010101010101010J, and the program written or to be written in the user area of the main storage device 2 cannot be erased.
そして、プロテクトレジスタa1のMSDの1ビット(
すなわち″1″)がキーボード部4のI/Oポート66
に送られ、入力用ラッチ回路74のMSDにセットされ
る。Then, 1 bit of MSD of protect register a1 (
In other words, "1") is the I/O port 66 of the keyboard section 4.
and is set in the MSD of the input latch circuit 74.
従って、プログラム保護表示ランプ70が点灯し、プロ
グラム保護キー20がロック状態にあること、すなわち
プログラムが消去不可能であることが表示される。Therefore, the program protection indicator lamp 70 lights up, indicating that the program protection key 20 is in the locked state, that is, the program cannot be erased.
上記説明はプログラム保護キー20が操作されたときの
動作に関するものであるが、プログラム保護キー20以
外のキーが操作されたと判断されたときには、第5図に
示す如く実行キー68が操作されたか否かが判断され、
実行キー68が操作されたものではないと判断されると
、他の入力処理が行われる。The above explanation relates to the operation when the program protection key 20 is operated, but when it is determined that a key other than the program protection key 20 has been operated, it is determined whether the execution key 68 has been operated or not, as shown in FIG. is judged,
If it is determined that the execution key 68 has not been operated, other input processing is performed.
また、実行キー68が操作されたものと判断されると第
5図に示すように、バツファメモリからデータが読み込
まれる。Further, when it is determined that the execution key 68 has been operated, data is read from the buffer memory as shown in FIG.
そして、次に最初のデータが数1直か否かが判断され、
数値でない場合にはマニュアル計算の入力処理が行われ
る。Then, it is determined whether the first data is number 1 or not,
If it is not a numerical value, manual calculation input processing is performed.
最初のデータが数値である場合には、読み出されたデー
タが最後まで数値か否かが判断され、最後まで数値の場
合にはプログラム保護キー20がロック状態にあるか否
か(すなわちプログラムが消去不可能となっているか否
か)が判断され、ロック状態にあればマニュアル計算入
力処理が行われる。If the first data is a numeric value, it is determined whether the read data is a numeric value to the end, and if the data is a numeric value to the end, it is determined whether the program protection key 20 is in the locked state (that is, the program is It is determined whether the data cannot be erased or not, and if it is in the locked state, manual calculation input processing is performed.
ロック状態になければ、読み出されたデータが行番号の
みか否かが判断され、行番号のみの場合にはプログラム
ステートメントがクリアされるように処理され、行番号
以外のデータがある場合には、プログラムステートメン
トの入力処理が行われる。If it is not in the locked state, it is determined whether the read data is only the line number, and if it is only the line number, the program statement is cleared, and if there is data other than the line number, it is processed. , input processing of program statements is performed.
また、読み出されたデータが最後まで数値でない場合に
は、数字の次は記号か否かが判断され、記号の場合には
マニュアル計算の入力処理が行われる。Furthermore, if the read data is not a numeric value to the end, it is determined whether the next digit is a symbol or not, and if it is a symbol, manual calculation input processing is performed.
記号でない場合には行番号のみか否かが判断され、行番
号のみの場合にはプログラムステートメントがクリアさ
れ、行番号以外のデータがある場合にはプログラムステ
ートメントの入力処理が行われる。If it is not a symbol, it is determined whether it is only a line number. If it is only a line number, the program statement is cleared, and if there is data other than the line number, input processing of the program statement is performed.
第8図および第9図は、
のようなプログラムをキーボード部4から主記憶装置2
に書込んだときのこのプログラムの行番号テーブル22
とソースプログラム領域24の記憶状態をそれぞれ示す
ものである。8 and 9 show programs such as
Line number table 22 of this program when written to
and the storage state of the source program area 24, respectively.
このように書き込まれたプログラムはプログラム保護キ
ー20がロック状態にあるとき、換言すればプロテクト
レジスタa1がプログラムの消去が可能であることを記
憶しているかぎり消去されることがない。A program written in this manner will not be erased when the program protection key 20 is in the locked state, in other words, as long as the protect register a1 remembers that the program can be erased.
例えば、プログラム保護キー20がロック状態にあると
きに、キーを操作して行番号10、あるいは20等を書
き込んで実行キー68を操作してもプログラムは前に書
込まれたままの状態で保持される。For example, when the program protection key 20 is in the locked state, even if you operate the key to write line number 10, 20, etc. and then operate the execution key 68, the program will remain in the previously written state. be done.
もし、前に書き込んだプログラムを消去して別のプログ
ラムを書き込みたいときには、プログラム保護キー20
を解除状態として例えば、3 0 PRINT
C , A , Bなるプログラムステートメントを
書き込めば、前に書き込まれた行番号30のステートメ
ントは消去され、今書き込んだステートメントが記憶さ
れる。If you want to erase the previously written program and write another program, press the program protection key 20.
For example, 3 0 PRINT
If program statements C, A, and B are written, the previously written statement at line number 30 is erased, and the currently written statement is stored.
また、例えば、
のようなプログラムを書き込んだ後、行番号50のステ
ートメントを
のように変更したいときには、プログラム保護キー20
を解除状態として、上記ステートメントをキー操作によ
り入力し、実行キー68を操作すればよい。For example, after writing a program like this, if you want to change the statement at line number 50 to
It is sufficient to input the above statement by key operation, and then operate the execution key 68, with the above statement set to the released state.
また、前の書き込んだプログラムをそのまま保持したい
ときに、プログラム保護キー20をロック状態にしてお
けば、後に入力されたステートメントは無効となり、前
のプログラムは保護される。Furthermore, if the program protection key 20 is locked when it is desired to keep the previously written program as it is, statements input later will be invalidated and the previous program will be protected.
なお、上記実施例においては、プログラムの消去可能、
不可能をキーボードに設けられたキーにより、選択して
いるが、本発明はこれに限定されず、消去可能、不可能
を選択できる手段なら何でも使用できる。Note that in the above embodiment, the program can be erased,
Although "impossible" is selected using a key provided on the keyboard, the present invention is not limited to this, and any means that can select "erasable" and "impossible" can be used.
また、上記実施例では、プロテクトレジスタa1に01
01010101010101なるデータが記憶されて
いるときにはプログラム消去可能、101010101
0101010なるデータが記憶されているときには消
去不可能としたが、これらの組み合わせを反対あるいは
適宜変更してもよく、要するに二つの異なったデータの
一方が記憶されているときに消去可能、他方が記憶され
ているときに消去不可能というように設定すればよい。In addition, in the above embodiment, 01 is set in the protect register a1.
When the data 01010101010101 is stored, the program can be erased, 101010101
Although it is assumed that data 0101010 cannot be erased when it is stored, these combinations may be reversed or changed as appropriate.In short, it is possible to erase data when one of two different data is stored, and the other is stored. You can set it so that it cannot be deleted when it is deleted.
ただし、上記のようにOと1を交互に繰り返すデータを
記憶させておき選択手段を切換ごとにシフトさせるよう
にすれば装置構成が簡単となる。However, if the data that alternately repeats O and 1 is stored as described above and the selection means is shifted every time the selection is made, the device configuration can be simplified.
更に、上記実施例ではプログラムが消去可能か否かとい
うことをレジスタに記憶させているが、本発明はこれに
限定されず、磁気テープ等別の記憶装置に記憶させても
よいことはもちろんであり、またキーボードの入出力ポ
ートに記憶させておいてもよい。Further, in the above embodiment, whether or not the program is erasable is stored in the register, but the present invention is not limited to this, and it goes without saying that the information may be stored in another storage device such as a magnetic tape. Yes, or it may be stored in the input/output port of the keyboard.
以上の説明から明らかなように、本発明は、書き込まれ
たあるいはこれから書き込まれるプログラムを消去不可
能(ロック状態)とするか消去可能(解除状態)とする
かを選択する選択手段を設けるとともに、この選択手段
の選択内容を記憶する記憶装置をそなえ、この装置が、
プログラムの消去が不可能であることを記憶していると
きには何らの指示なしに数字等のデータが直接入力され
てもこのデータをマニュアル計算用とみなして前に書き
込まれたプログラムの記憶を保持するように制御するも
のであるから、従来のように伺らかのコマンドを与える
ことなしにマニュアル計算が行えるので計算機の操作が
簡便になるとともに、計算能率が向上する。As is clear from the above description, the present invention provides a selection means for selecting whether a program that has been written or will be written in the future is made non-erasable (locked state) or erasable (released state), and This device includes a storage device for storing the selection contents of the selection means, and this device
When remembering that the program cannot be erased, even if data such as numbers is input directly without any instructions, this data will be considered for manual calculation and the memory of the previously written program will be retained. Since the computer is controlled in this manner, manual calculations can be performed without giving special commands as in the past, making the computer easier to operate and improving calculation efficiency.
また、数字等を誤って入力させ且つ実行キーを押しても
前に書き込まれたプログラムは保持されるので、ミスオ
ペレーションによるプログラムの組みなおし等を行う必
要がないので作業能率が向上するという効果がある。Furthermore, even if a number or the like is entered incorrectly and the execution key is pressed, the previously written program is retained, so there is no need to reassemble the program due to a mistake, thereby improving work efficiency.
また、本発明はプログラムが消去可能か否かを記憶する
記憶装置を設けるのみでよいからマニュアル計算時に前
に書き込またプログラムを別の記憶装置に転送する保護
方式と異なり、装置構成が簡単であり、コスト的にも有
利である。In addition, the present invention requires only a storage device to store whether or not a program can be erased, so the device configuration is simple, unlike a protection method that transfers a previously written program to another storage device during manual calculation. , it is also advantageous in terms of cost.
第1図および第2図は本発明によるパーソナルコンピュ
ータの一実施例を示す斜視図およびブロック図、第3図
は本発明によるプロテクトレジスタの配置を示す説明図
、第4a図及び第4b図はプロアクトレジスタがプログ
ラムの消去不可能(プログラム保護キーロック状態)お
よび消去可能(プログラム保護キー解除状態)をそれぞ
れ記憶しているときのビット構成図、第5図は第1図お
よび第2図の実施例の動作を示すフローチャート、第6
a図は上記実施例の始動時における動作を示すフローチ
ャート、第6b図は上記実施例がプログラムを消去不可
能とすべきことを記憶するときの動作を示すフローチャ
ート、第7a図は上記実施例の始動時における各部の動
作状態を示す図表、第7b図は上記実施例がプログラム
を消去不可能とすべきことを記憶するときの動作を示す
図表、第8図および第9図はそれぞれ書き込まれたプロ
グラムの行番号テーブルにおける記憶状態およびソース
プログラム領域における記憶状態の一例を示す状態図で
ある。
1・・・・・・パーソナルコンピュータ、2・・・・・
・主記憶装置、3・・・・・・中央処理装置、4・・・
・・・キーボード部、5・・・・・・CRT表示部、1
6・・・・・−ワーキングレジスタ群、18・・・・・
・ワーキング領域、20・・・・・・プログラム保護キ
ー、46・・・・・・ALU、48・・・・・・レジス
タ群、68・・・・・・実行キー、70・・・・・・プ
ログラム保護表示ランプ、R1〜R12・・・・・・ワ
ーキングレジスタ、a1・・・・・・プロテクトレジス
タ。1 and 2 are perspective views and block diagrams showing one embodiment of a personal computer according to the present invention, FIG. 3 is an explanatory diagram showing the arrangement of a protect register according to the present invention, and FIGS. 4a and 4b are proact diagrams. A bit configuration diagram when the register stores programs that are non-erasable (program protection key locked state) and erasable (program protection key released state), respectively. Figure 5 is an example of the implementation of Figures 1 and 2. 6th flowchart showing the operation of
Fig. 6a is a flowchart showing the operation of the above embodiment at startup, Fig. 6b is a flowchart showing the operation of the above embodiment when storing that the program should be made non-erasable, and Fig. 7a is the flowchart of the above embodiment. A chart showing the operating state of each part at the time of startup, FIG. 7b is a chart showing the operation when the above embodiment memorizes that the program should be made non-erasable, and FIGS. 8 and 9 are respectively written. FIG. 3 is a state diagram showing an example of a storage state in a program line number table and a storage state in a source program area. 1...Personal computer, 2...
・Main storage device, 3...Central processing unit, 4...
...Keyboard section, 5...CRT display section, 1
6...- Working register group, 18...
- Working area, 20...Program protection key, 46...ALU, 48...Register group, 68...Execution key, 70... -Program protection indicator lamp, R1 to R12... Working register, a1... Protect register.
Claims (1)
びにマニュアル計算をなし得る電子計算機において、書
込まれたプログラムを記憶する第1記憶装置と、この第
1記憶装置に記憶されるプログラムを消去可能とするか
消去不可能とするかを選択する選択手段と、この選択手
段の選択内容を記憶すを第2記憶装置と、この第2記憶
装置が前記プログラムの消去を不可能とすべきことを記
憶しているときには入力データを前記マニュアル計算用
データとみなして前記第1記憶装置に書き込まれている
プログラムを記憶保持させる制御手段とを具備したプロ
グラム保護装置。1. In an electronic computer capable of performing arithmetic processing based on a pre-written program and manual calculation, is there a first storage device that stores the written program, and whether the program stored in this first storage device can be erased? a selection means for selecting whether to make the program non-erasable; a second storage device for storing the selection contents of the selection means; and a second storage device for storing the fact that the program should be made non-erasable. and control means for storing and retaining the program written in the first storage device by regarding the input data as the manual calculation data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP52159709A JPS5837582B2 (en) | 1977-12-27 | 1977-12-27 | program protection device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP52159709A JPS5837582B2 (en) | 1977-12-27 | 1977-12-27 | program protection device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS5489542A JPS5489542A (en) | 1979-07-16 |
| JPS5837582B2 true JPS5837582B2 (en) | 1983-08-17 |
Family
ID=15699571
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP52159709A Expired JPS5837582B2 (en) | 1977-12-27 | 1977-12-27 | program protection device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5837582B2 (en) |
-
1977
- 1977-12-27 JP JP52159709A patent/JPS5837582B2/en not_active Expired
Also Published As
| Publication number | Publication date |
|---|---|
| JPS5489542A (en) | 1979-07-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7340589B2 (en) | Shift prefix instruction decoder for modifying register information necessary for decoding the target instruction | |
| JPH0470662B2 (en) | ||
| GB1153025A (en) | Electronic Calculator | |
| EP0032955B1 (en) | Microprogram controlled data processor | |
| US4138734A (en) | Electronic equipment capable of arithmetic operations | |
| JPH0570175B2 (en) | ||
| US4432056A (en) | Programmable electronic computer | |
| JPS5837582B2 (en) | program protection device | |
| JPH0117185B2 (en) | ||
| US4554641A (en) | Programmable calculator | |
| US4959778A (en) | Address space switching apparatus | |
| JP4284559B2 (en) | Microprocessor, microcomputer, electronic equipment | |
| US4564304A (en) | Typewriter with resetting function for margin position and tab position | |
| JPS6059627B2 (en) | Printing control device | |
| JPS6235130B2 (en) | ||
| JPS627593B2 (en) | ||
| JPH0537314Y2 (en) | ||
| JP2575620B2 (en) | Data processing device | |
| JPH0115906B2 (en) | ||
| JPS6113623B2 (en) | ||
| JP2600654B2 (en) | Document processing device | |
| JP2576088B2 (en) | Electronic equipment with data storage device | |
| JPH01158556A (en) | Device for setting operational mode of electronic calculator | |
| JPS6033475Y2 (en) | Small electronic calculator with program | |
| JPS5968054A (en) | Information processor |