JP3231467B2 - Information recording medium with built-in CPU - Google Patents

Information recording medium with built-in CPU

Info

Publication number
JP3231467B2
JP3231467B2 JP08933093A JP8933093A JP3231467B2 JP 3231467 B2 JP3231467 B2 JP 3231467B2 JP 08933093 A JP08933093 A JP 08933093A JP 8933093 A JP8933093 A JP 8933093A JP 3231467 B2 JP3231467 B2 JP 3231467B2
Authority
JP
Japan
Prior art keywords
processing
instruction
address
cpu
recording medium
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
Application number
JP08933093A
Other languages
Japanese (ja)
Other versions
JPH06282700A (en
Inventor
和義 入澤
博嗣 針間
輝明 城
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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP08933093A priority Critical patent/JP3231467B2/en
Publication of JPH06282700A publication Critical patent/JPH06282700A/en
Application granted granted Critical
Publication of JP3231467B2 publication Critical patent/JP3231467B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、CPUを内蔵した情報
記録媒体、特に、外部から与えられる複数の命令コード
のそれぞれに対応した所定の仕事を実行するCPUを内
蔵した情報記録媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an information recording medium having a built-in CPU, and more particularly to an information recording medium having a built-in CPU for executing a predetermined task corresponding to each of a plurality of externally applied instruction codes.

【0002】[0002]

【従来の技術】磁気カードに代わる新しい情報記録媒体
として、ICカードが注目を集めている。特に、CPU
を内蔵したICカードは、高度なセキュリティを有する
ため、種々の分野での利用が期待されている。一般にI
Cカードは、RAM,ROM,EEPROMといった3
種類のメモリを内蔵しており、いずれも内蔵CPUによ
ってアクセスされる。ICカードに対するデータの授受
は、リーダライタ装置によって行われる。リーダライタ
装置からICカードに対して所定の命令コードを与える
と、この命令コードはICカード内のCPUによって解
読され、これに対応した所定の仕事が実行される。たと
えば、データの書込命令であれば、リーダライタ装置か
らICカードへ与えたデータがICカード内のメモリに
書き込まれ、データの読出命令であれば、ICカード内
のメモリから読み出されたデータがリーダライタ装置へ
転送される。
2. Description of the Related Art As a new information recording medium replacing a magnetic card, an IC card has attracted attention. In particular, CPU
An IC card with a built-in is expected to be used in various fields because of its high security. Generally I
The C card has three types such as RAM, ROM, and EEPROM.
There are various types of memories, all of which are accessed by the built-in CPU. The transfer of data to and from the IC card is performed by a reader / writer device. When a predetermined instruction code is given from the reader / writer device to the IC card, the instruction code is decoded by the CPU in the IC card, and a predetermined job corresponding to the instruction code is executed. For example, in the case of a data write command, data given from the reader / writer device to the IC card is written in the memory in the IC card, and in the case of a data read command, data read from the memory in the IC card is used. Is transferred to the reader / writer device.

【0003】一般に、ICカードに対して与える命令は
数十種類程度用意されている。たとえば、同じ書込命令
であっても、レコード単位のデータ書き込みを行う命令
と、バイナリデータの書き込みを行う命令と、では異な
る命令となる。また、メモリに対する書き込み/読み出
しだけではなく、ファイルのロック/アンロックを行う
命令、新たなファイルを定義する命令、ファイルを消去
する命令、キーの照合を行う命令、自己診断ルーチンを
実行させる命令、など様々な仕事を行うために様々な命
令が用いられているのが実情である。これらの命令は、
それぞれ固有の命令コードの形式で、リーダライタ装置
からICカードへと伝達される。ICカード内のCPU
は、与えられた命令コードに基づいて、ROM内の所定
のルーチンを実行することになる。
[0003] In general, dozens of types of instructions given to IC cards are prepared. For example, even for the same write command, a command for writing data in record units and a command for writing binary data are different commands. An instruction to lock / unlock a file, an instruction to define a new file, an instruction to delete a file, an instruction to verify a key, an instruction to execute a self-diagnosis routine, In fact, various commands are used to perform various tasks. These instructions are
Each instruction code is transmitted from the reader / writer device to the IC card in the form of a unique instruction code. CPU in IC card
Executes a predetermined routine in the ROM based on the given instruction code.

【0004】[0004]

【発明が解決しようとする課題】上述したように、通
常、ICカードに対して与える命令は数十種類ほどあ
り、ROM内には、これら各命令ごとに別個の処理ルー
チンが用意されている。ところが、ICカードのような
携帯型の情報記録媒体は、小型化する必要性から、メモ
リの容量には制限があり、ROM内に用意するプログラ
ムはできるだけ省容量化することが好ましい。
As described above, there are usually several tens of instructions given to an IC card, and a separate processing routine is prepared for each of these instructions in the ROM. However, a portable information recording medium such as an IC card has a limited memory capacity due to the necessity of miniaturization, and it is preferable that the programs prepared in the ROM be as small as possible.

【0005】そこで本発明は、外部から与えられた命令
を実行するためのプログラムサイズをより低減すること
のできるCPUを内蔵した情報記録媒体を提供すること
を目的とする。
An object of the present invention is to provide an information recording medium having a built-in CPU capable of further reducing the size of a program for executing an externally applied instruction.

【0006】[0006]

【課題を解決するための手段】(1) 本願第1の発明
は、外部から与えられる複数の命令コードのそれぞれに
対応した所定の仕事を実行するCPUを内蔵した情報記
録媒体において、各仕事に共通した共通処理を行うため
の共通処理プログラムと、各仕事ごとに別々な固有処理
を行うための固有処理プログラムと、をそれぞれ独立し
て格納したプログラム格納用メモリと、 複数の命令コー
ドについて、それぞれ使用頻度順に連続した番号からな
る命令番号を対応づける命令番号テーブルと、 各命令番
号に対して、それぞれ分岐先となる固有処理プログラム
のアドレスを対応づけるアドレステーブルと、 外部から
所定の命令コードが与えられたときに、命令番号テーブ
ルを使用頻度の高い方から順に参照することにより対応
する命令番号を求め、この命令番号を一時記憶する準備
処理を実行した後、共通処理プログラムと固有処理プロ
グラムとを所定の順序で実行する機能を有し、かつ、固
有処理プログラムを実行する際には、アドレステーブル
を参照することにより、記憶した命令番号に対応するア
ドレスを求め、このアドレス先の固有処理プログラムを
選択的に実行する機能を有する処理実行部と、 を設ける
ようにしたものである。
SUMMARY OF THE INVENTION (1) the first invention is an information recording medium with a built-in CPU for executing predetermined work corresponding to each of a plurality of instruction codes given from the outside, in each work To perform common common processing
Common processing program and separate specific processing for each job
And a unique processing program for performing
And a memory for program storage that stores Te, a plurality of instructions code
For each code, start with a consecutive number in the order of frequency of use.
Instruction number table that associates the instruction numbers
Specific processing program to be branched to for each issue
The address and associating address table, from the outside
When given instruction code is given, instruction number table
By referencing files in order of frequency of use
Prepare the instruction number to execute and temporarily store this instruction number.
After executing the processing, the common processing program and the specific processing program
Have the function of executing the programs in a predetermined order.
When executing the processing program with
By referring to the address corresponding to the stored instruction number.
Address, and execute a unique processing program at this address.
Providing a processing execution section which has a function of executing selectively, the
It is like that.

【0007】(2) 本願第2の発明は、上述の第1の発
明に係るCPUを内蔵した情報記録媒体において、処理
実行部が、命令番号に関するインクリメント処理もしく
はデクリメント処理を行うたびに、アドレステーブル内
の1つのアドレスを指し示すポインタを移動させる処理
を行い、インクリメント処理もしくはデクリメント処理
の結果が所定の値に達したときにポインタによって指し
示されていたアドレス先の固有処理プログラムを選択的
に実行するようにしたものである。
(2) The second invention of the present application is a processing method for an information recording medium having a built-in CPU according to the first invention.
The execution unit may perform an increment process on the instruction number or
Is stored in the address table each time the decrement process is performed.
For moving a pointer pointing to one address of
And increment or decrement
Pointed by the pointer when the result of
Select the specific processing program at the indicated address destination
Is executed.

【0008】[0008]

【0009】[0009]

【0010】[0010]

【作 用】一般に、いくつかの命令についての処理ルー
チン内には、共通した処理を行う部分が存在する。本発
明では、この共通した処理の部分を共通処理のルーチン
として抜き出し、この共通処理ルーチンを、複数の命令
の実行において共通して利用できるようにしている。こ
のため、全プログラム容量を低減することができる。ま
た、各命令について固有の処理ルーチンを実行する場合
の分岐は、個々の命令に対して、それぞれ使用頻度順に
所定の命令番号を定義しておき、この命令番号を参照し
た上で行われるため、効率的な分岐が可能になる。
[Operation] In general, a processing routine for some instructions has a part for performing common processing. In the present invention, the common processing part is extracted as a common processing routine, and the common processing routine is commonly used for executing a plurality of instructions. Therefore, the total program capacity can be reduced. In addition, when executing a processing routine specific to each instruction, branching is performed for each instruction in order of use frequency.
Define a specific instruction number and refer to this instruction number.
, The branching can be performed efficiently.

【0011】[0011]

【実施例】以下、本発明を図示する実施例に基づいて説
明する。図1は一般的なICカード10をリーダライタ
装置20に接続した状態を示すブロック図である。IC
カード10内には、リーダライタ装置20と接続するた
めのI/O装置11と、CPU12と、RAM13と、
ROM14と、EEPROM15と、が内蔵されてい
る。CPU12は、I/O装置11を介してリーダライ
タ装置20から与えられる命令を受け取り、これを実行
する。3種類のメモリのうち、RAM13は揮発性のメ
モリであって、CPU12のワークエリアとして利用さ
れる。ROM14およびEEPROM15は、いずれも
不揮発性のメモリであるが、ROM14は読出し専用で
あるのに対し、EEPROMは随時書き換えを行うこと
ができる。このため、ROM14には、CPU12に実
行させるプログラムが用意され、EEPROM15に
は、ユーザデータがファイルごとに記録される。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the illustrated embodiments. FIG. 1 is a block diagram showing a state where a general IC card 10 is connected to a reader / writer device 20. IC
In the card 10, an I / O device 11 for connecting to a reader / writer device 20, a CPU 12, a RAM 13,
The ROM 14 and the EEPROM 15 are built in. The CPU 12 receives a command given from the reader / writer device 20 via the I / O device 11, and executes the command. Of the three types of memory, the RAM 13 is a volatile memory and is used as a work area of the CPU 12. The ROM 14 and the EEPROM 15 are both non-volatile memories. The ROM 14 is read-only, while the EEPROM can be rewritten at any time. Therefore, a program to be executed by the CPU 12 is prepared in the ROM 14, and user data is recorded in the EEPROM 15 for each file.

【0012】図2は、リーダライタ装置20からICカ
ード10に対して、所定の命令が与えられた場合、IC
カード10内部における従来の処理方法の手順を示す流
れ図である。まず、ステップS1において、ICカード
10に対する命令の入力が行われる。前述したように、
この命令は所定の命令コード(たとえば、1バイトのコ
ード)としてCPU12に与えられることになる。CP
U12は、ステップS2において、この命令コードに対
応する仕事を行うための処理ルーチンへ分岐を行う。そ
して、ステップS3において、分岐先であるいずれか1
つのルーチンが実行される。図2に示す例では、合計6
種類の命令を実行するために、6種類のルーチンが用意
されているが、実際にはより多くの命令について、それ
ぞれ別個のルーチンがROM14内に用意されることに
なる。このように、1つの命令ごとに1つの独立したル
ーチンを用意した場合、これらのルーチンを保存するた
めにROM14内のかなりの容量が占有されることにな
る。
FIG. 2 shows that when a predetermined command is given from the reader / writer device 20 to the IC card 10,
9 is a flowchart showing a procedure of a conventional processing method inside the card 10. First, in step S1, a command is input to the IC card 10. As previously mentioned,
This instruction is given to the CPU 12 as a predetermined instruction code (for example, a one-byte code). CP
U12 branches to a processing routine for performing the work corresponding to the instruction code in step S2. Then, in step S3, any one of the branch destinations
Two routines are executed. In the example shown in FIG.
Six types of routines are prepared for executing the types of instructions, but actually, separate routines are prepared in the ROM 14 for more instructions. As described above, when one independent routine is prepared for each instruction, a considerable capacity in the ROM 14 is occupied for storing these routines.

【0013】本発明は、一般に、複数のルーチンが共通
した処理内容を含んでいるという点に着目し、この共通
処理の部分については、共通の処理ルーチンを用意する
ようにしたものである。たとえば、図2に示した6つの
ルーチン1〜6が、それぞれ図3に示すような5つの処
理を含んでいた場合を考える。そして、処理A1〜A6
は、ほぼ同じ内容の処理であるために、共通処理Aとし
てまとめることができ、同様に、処理C1〜C6も共通
処理Cとしてまとめることができ、処理E1〜E6も共
通処理Eとしてまとめることができる理想的な場合をモ
デルとして考える。通常、6つのルーチン1〜6は、そ
れぞれ別個独立して作成されるため、たとえば、6つの
処理A1〜A6が、プログラムの記述として完全に一致
することは希である。しかしながら、これらの処理が、
ほぼ同じ内容を意図する処理であれば、6つの処理A1
〜A6について汎用できる共通処理Aを記述することは
可能である。この共通処理Aのためのプログラム容量
は、1つの処理A1のためのプログラム容量よりも増え
るかもしれないが、6つの処理A1〜A6の合計プログ
ラム容量よりは減るものと考えられる。そこで、共通処
理A,C,Eを用意し、それぞれを、処理A1〜A6,
処理C1〜C6,処理E1〜E6の代わりに用いれば、
全体のプログラム容量を低減させることができる。
The present invention focuses on the fact that a plurality of routines generally include common processing contents, and a common processing routine is prepared for this common processing part. For example, consider a case where the six routines 1 to 6 shown in FIG. 2 each include five processes as shown in FIG. Then, processing A1 to A6
Since the processes have almost the same contents, they can be grouped as a common process A. Similarly, the processes C1 to C6 can be grouped as a common process C, and the processes E1 to E6 can also be grouped as a common process E. The ideal case is considered as a model. Normally, the six routines 1 to 6 are created separately and independently, so that, for example, the six processes A1 to A6 rarely completely match as program descriptions. However, these processes
If the processes are intended to have almost the same contents, six processes A1
It is possible to describe a common process A that can be generally used for .about.A6. The program capacity for the common process A may be larger than the program capacity for one process A1, but is considered to be smaller than the total program capacity of the six processes A1 to A6. Therefore, common processes A, C, and E are prepared, and the processes A1 to A6 are respectively performed.
If used instead of processes C1 to C6 and processes E1 to E6,
The overall program capacity can be reduced.

【0014】図4は、上述のような思想に基づいて、I
Cカード10内で行われる具体的な処理方法の手順を示
す流れ図である。まず、ステップS10において、IC
カード10に対する命令の入力が行われる。ICカード
10は、入力された命令が6つの命令のいずれであって
も、ステップS11における共通処理Aを実行する。こ
の共通処理Aが完了すると、続くステップS12におい
て分岐が行われる。入力された命令が6つの命令のいず
れかであるかによって、6つの固有処理のうちのいずれ
かに分岐するのである。こうして、ステップS13で
は、6つの固有処理B1〜B6のうちのいずれかが実行
される。続くステップS14で、共通処理Cが実行され
た後、ステップS15において分岐が行われる。すなわ
ち、ステップS16で、6つの固有処理D1〜D6のう
ちのいずれかが実行される。そして最後に、ステップS
17において、共通処理Eが実行される。このような手
順を行えば、いずれの命令についても、図3に示す処理
と等価な処理が実施されることになる。
FIG . 4 is a graph showing the relationship between I and I based on the above-described concept.
5 is a flowchart showing a procedure of a specific processing method performed in the C card 10. First, in step S10, the IC
An instruction is input to the card 10. The IC card 10 executes the common process A in step S11, regardless of the input command being any of the six commands. When the common processing A is completed, a branch is performed in a succeeding step S12. Depending on whether the input instruction is one of the six instructions, the process branches to one of the six specific processes. Thus, in step S13, any one of the six unique processes B1 to B6 is executed. After the common process C is performed in the subsequent step S14, a branch is performed in step S15. That is, in step S16, any one of the six unique processes D1 to D6 is executed. And finally, step S
At 17, common processing E is performed. By performing such a procedure, a process equivalent to the process shown in FIG. 3 is performed for any instruction.

【0015】ところで、図4におけるステップS12,
S15に示されているように、共通処理から各固有処理
へと移行する際に、分岐を行う必要がある。本発明で
は、この分岐を次のような方法により効率的に行ってい
る。まず、ROM14内に、図5に示すような命令番号
テーブルと、図6に示すようなアドレステーブルを用意
しておく。命令番号テーブルは、6つの命令それぞれに
ついての命令コード(1バイトのコード)に対して、連
続した番号「1〜6」からなる命令番号を対応づけるテ
ーブルである。図5に示す例では、たとえば、命令コー
ド「A6」は、命令番号「1」に対応づけられている。
一方、アドレステーブルは、各命令番号に対して、分岐
先となる固有処理の先頭アドレスを対応づけるテーブル
である。たとえば、図5のテーブルに示す6つの命令コ
ード「A6」,「B4」,…,「2A」が、それぞれ固
有処理B1〜B6に分岐すべき命令であった場合には、
図6のテーブルに示されているように、アドレステーブ
ルには、命令番号1〜6に対応して、それぞれ固有処理
B1〜B6の先頭アドレス値が記録されることになる。
なお、実際のアドレステーブルとしては、アドレス値だ
けを記録しておけば十分であり、命令番号そのものを記
録しておく必要はない。図6に示すテーブルは、ステッ
プS12における分岐に関してのものであり、ステップ
S15における分岐に関しても、固有処理D1〜D6の
先頭アドレス値を記録した同様のアドレステーブルが用
意される。
By the way, in step S12 in FIG.
As shown in S15, when shifting from common processing to each unique processing, it is necessary to branch. In the present invention, this branching is efficiently performed by the following method. First, an instruction number table as shown in FIG. 5 and an address table as shown in FIG. 6 are prepared in the ROM 14. The instruction number table is a table that associates instruction numbers (one-byte codes) of six instructions with instruction numbers consisting of consecutive numbers “1 to 6”. In the example shown in FIG. 5, for example, the instruction code “A6” is associated with the instruction number “1”.
On the other hand, the address table is a table for associating each instruction number with a start address of a unique process to be a branch destination. For example, if the six instruction codes “A6”, “B4”,..., “2A” shown in the table of FIG.
As shown in the table of FIG. 6, in the address table, the head address values of the unique processes B1 to B6 are recorded corresponding to the instruction numbers 1 to 6, respectively.
It is sufficient to record only the address value as an actual address table, and it is not necessary to record the instruction number itself. The table shown in FIG. 6 relates to the branch in step S12, and a similar address table in which the head address values of the unique processes D1 to D6 are recorded also for the branch in step S15.

【0016】このような命令番号テーブルおよびアドレ
ステーブルを用意しておくことにより、次のような効率
的な分岐処理が可能になる。ここでは、命令コード「E
2」が与えられた場合を例にとって、この分岐処理を説
明する。まず、ステップS10において、命令の入力が
行われると、CPU12は、与えられた命令コード「E
2」に対応する命令番号を、図5に示す命令番号テーブ
ルを検索して認識する。この例の場合、命令コード「E
2」に対応する命令番号「3」が得られる。この命令番
号「3」は、RAM13の所定領域に一時的に書き込ま
れる。続いて、ステップS11の共通処理Aが行われた
後、ステップS12の分岐処理が行われる。まず、図6
に示すアドレステーブルの第1欄(図にアドレスAdd
1と記した位置)を所定のポインタに指示させた後、R
AM13に一時的に書き込まれている命令番号「3」を
所定のレジスタ(あるいは、RAM13の別な領域でも
よい)にロードする。そして、このレジスタの内容をデ
クリメントして、「0」になったか否かを判断する。
「0」になっていたら、そのときポインタが指示してい
るアドレステーブル欄に記録された固有処理の先頭アド
レス値を読み取り、この先頭アドレスからのルーチンに
ジャンプする。「0」になっていなければ、ポインタを
次の欄に移動させ(第1欄から第2欄に移動させる)、
再びレジスタの内容をデクリメントして「0」になった
か否かを判断する。このような処理を繰り返せば、レジ
スタが「0」になった時点で、正しい固有処理ルーチン
への分岐を行うことができる。上述の例では、レジスタ
の最初の値は「3」であるから、ポインタが第3欄(図
にアドレスAdd3と記した位置)まで移動したときに
レジスタは「0」になり、固有処理B3へと分岐するこ
とになる。レジスタの内容のデクリメント処理や、レジ
スタの内容が「0」か否かの判断処理は、一般的なCP
U12が備えている基本的処理であるため、極めて効率
良く実行することができる。
By preparing such an instruction number table and address table, the following efficient branch processing can be performed. Here, the instruction code “E
This branching process will be described by taking a case where "2" is given as an example. First, in step S10, when an instruction is input, the CPU 12 sets the given instruction code “E
The instruction number corresponding to "2" is recognized by searching the instruction number table shown in FIG. In this example, the instruction code “E
The instruction number "3" corresponding to "2" is obtained. This instruction number “3” is temporarily written in a predetermined area of the RAM 13. Subsequently, after the common processing A in step S11 is performed, the branch processing in step S12 is performed. First, FIG.
The first column of the address table shown in FIG.
After a predetermined pointer is pointed to by a predetermined pointer, the R
The instruction number “3” temporarily written in the AM 13 is loaded into a predetermined register (or another area of the RAM 13). Then, the content of this register is decremented, and it is determined whether or not it becomes "0".
If the value is "0", the head address value of the unique processing recorded in the address table column pointed to by the pointer at that time is read, and the routine jumps from this head address. If it is not "0", move the pointer to the next column (move from the first column to the second column),
The contents of the register are decremented again, and it is determined whether or not the value has become "0". By repeating such processing, it is possible to branch to a proper unique processing routine when the register becomes “0”. In the above example, since the initial value of the register is "3", the register becomes "0" when the pointer moves to the third column (the position indicated by the address Add3 in the figure), and the process proceeds to the unique process B3. Will be branched. The process of decrementing the contents of a register and the process of determining whether or not the contents of a register are “0” are performed by a general CP.
Since this is a basic process provided by U12, it can be executed extremely efficiently.

【0017】アドレステーブルを用いる代わりに、共通
処理Aのルーチンの最後に、図7に示すようなプログラ
ム(CPU12が、特定のレジスタに対するロード命
令、インクリメント命令(INC)、比較命令(CM
P)、比較結果に基づくジャンプ命令(JMP)を実行
する機能をもっているという想定におけるプログラム)
を追加する方法を採ってもよい。まず、ステップにお
いて、RAM13に一時的に書き込まれている命令番号
「3」をレジスタR0にロードする。そして、ステップ
において、レジスタR1に初期値「0」をロードす
る。ステップでは、レジスタR1の内容をインクリメ
ントし、ステップでは、両レジスタの内容を比較す
る。そして、両レジスタの内容が一致した場合には、ス
テップにおいて、固有処理B1の先頭アドレスへジャ
ンプする。不一致の場合は、ステップでレジスタR1
の内容をインクリメントし、ステップで、両レジスタ
の内容を比較する。両者が一致したら、ステップにお
いて、固有処理B2の先頭アドレスへジャンプする。不
一致の場合は、ステップでレジスタR1の内容をイン
クリメントする。以下、同様に、レジスタR1のインク
リメント、両レジスタの比較、一致したらジャンプ、と
いうステップを繰り返せばよい。レジスタの内容のイン
クリメント処理や、レジスタ同士の比較判断処理は、一
般的なCPU12が備えている基本的処理であるため、
このような分岐処理も極めて効率良く実行することがで
きる。
Instead of using the address table, at the end of the routine of the common processing A, a program as shown in FIG. 7 (the CPU 12 executes a load instruction for a specific register, an increment instruction (INC), and a comparison instruction (CM
P), a program assuming that it has a function to execute a jump instruction (JMP) based on the comparison result)
May be added. First, in a step, the instruction number "3" temporarily written in the RAM 13 is loaded into the register R0. Then, in a step, the initial value “0” is loaded into the register R1. In the step, the contents of the register R1 are incremented, and in the step, the contents of both registers are compared. If the contents of the two registers match, in a step, the process jumps to the start address of the unique processing B1. If they do not match, step R1
Is incremented, and the contents of both registers are compared in a step. If they match, in a step, the process jumps to the start address of the unique process B2. If not, the contents of the register R1 are incremented in a step. Hereinafter, similarly, the steps of incrementing the register R1, comparing the two registers, and jumping if they match, may be repeated. Since the process of incrementing the contents of the registers and the process of comparing and judging the registers are basic processes provided in a general CPU 12,
Such branch processing can also be executed extremely efficiently.

【0018】なお、上述した分岐処理の効率を更に向上
させるためには、図5に示す命令番号テーブルにおい
て、各命令コードに対して使用頻度順に命令番号を付す
ようにするのが好ましい。図5の例では、命令コード
「A6」が最も使用頻度の高い命令であり、以下、命令
コード「B4」,「E2」,「58」,「85」,「2
A」の順に続くようになっていればよい。上述したデク
リメント処理あるいはインクリメント処理を利用した分
岐処理は、命令番号が若いほど、デクリメントあるいは
インクリメントの回数が少なくなり、処理時間が短くな
る。したがって、使用頻度順に命令番号を付すようにす
れば、使用頻度の高い命令ほど、分岐にかかる処理時間
が短くなり効率的である。
In order to further improve the efficiency of the above-described branch processing, it is preferable to assign instruction numbers to the instruction codes in the order of use frequency in the instruction number table shown in FIG. In the example of FIG. 5, the instruction code “A6” is the instruction that is used most frequently, and the instruction codes “B4”, “E2”, “58”, “85”, “2”
It is only necessary to continue in the order of "A". In the branch processing using the decrement processing or the increment processing described above, as the instruction number is smaller, the number of times of decrement or increment is reduced, and the processing time is shortened. Therefore, if instruction numbers are assigned in order of use frequency, the more frequently used instructions are used, the shorter the processing time required for branching and the more efficient the instructions.

【0019】以上、本発明を図示する実施例に基づいて
説明したが、本発明はこの実施例のみに限定されるもの
ではなく、この他にも種々の態様で実施可能である。た
とえば、上述の実施例は、ICカードに本発明を適用し
た例であるが、本発明は、CPUを内蔵した情報記録媒
体に広く適用可能である。また、図4に示した例は、6
つのルーチンのいずれもが、共通処理A,C,Eを有す
るという理想的なモデルであるが、実際には、たとえば
ルーチン1,2は処理Aを共通とし、ルーチン2,3は
処理Cを共通とする、というように、共通部分が複数の
ルーチン間で複雑に入り混じっていることが多いものと
思われる。このような場合であっても、共通する処理部
分を有するいくつかのルーチン同士について、その部分
を共通処理として一本化すればよい。要するに、本発明
の基本思想は、複数のルーチン間で処理が共通する部分
が存在した場合に、これを共通の処理ルーチンとしてま
とめるという点にあり、この基本思想から逸脱しない限
り、どのような適用を行ってもかまわない。
Although the present invention has been described based on the illustrated embodiment, the present invention is not limited to this embodiment, but can be implemented in various other modes. For example, the above-described embodiment is an example in which the present invention is applied to an IC card, but the present invention is widely applicable to an information recording medium having a built-in CPU. The example shown in FIG.
Although each of the two routines is an ideal model having common processes A, C, and E, in practice, for example, routines 1 and 2 share process A, and routines 2 and 3 share process C. It seems that common parts are often mixed and complicated among multiple routines. Even in such a case, for some routines having a common processing part, the part may be unified as a common processing. In short, the basic idea of the present invention lies in that when there is a part where the processing is common between a plurality of routines, this is put together as a common processing routine. You can go.

【0020】[0020]

【発明の効果】以上のとおり本発明に係る情報記録媒体
によれば、複数の命令についての共通処理ルーチンを共
通して利用するようにしたため、全プログラム容量を低
減することができる。また、各命令コードに対して使用
頻度順に命令番号を付すようにしたため、命令実行時に
命令番号テーブルを参照する時間が短縮され、処理の高
速化が図れる。
As described above, according to the information recording medium of the present invention, the common processing routine for a plurality of instructions is commonly used, so that the total program capacity can be reduced. In addition, since instruction numbers are assigned to the instruction codes in order of use frequency, the time for referring to the instruction number table when executing instructions is reduced, and the processing can be speeded up.

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

【図1】一般的なICカード10をリーダライタ装置2
0に接続した状態を示すブロック図である。
FIG. 1 shows a general IC card 10 connected to a reader / writer 2
It is a block diagram showing the state connected to 0.

【図2】図1に示すICカード10にリーダライタ装置
20から、所定の命令が与えられた場合、ICカード1
0内部における従来の処理方法の手順を示す流れ図であ
る。
FIG. 2 is a diagram showing an example in which a predetermined command is given from the reader / writer device 20 to the IC card 10 shown in FIG.
0 is a flow chart showing the procedure of a conventional processing method inside 0.

【図3】図2に示す各ルーチンの処理内容の一モデル例
を示す図である。
FIG. 3 is a diagram showing an example of a model of processing contents of each routine shown in FIG. 2;

【図4】図1に示すICカード10にリーダライタ装置
20から、所定の命令が与えられた場合、ICカード1
0内部における本発明の処理方法の手順を示す流れ図で
ある。
FIG. 4 is a diagram showing an example in which a predetermined command is given from the reader / writer device 20 to the IC card 10 shown in FIG.
0 is a flowchart showing the procedure of the processing method of the present invention inside 0.

【図5】図4に示す処理における分岐に用いる命令番号
テーブルの一例を示す図である。
FIG. 5 is a diagram showing an example of an instruction number table used for branching in the processing shown in FIG. 4;

【図6】図4に示す処理における分岐に用いるアドレス
テーブルの一例を示す図である。
FIG. 6 is a diagram illustrating an example of an address table used for branching in the processing illustrated in FIG. 4;

【図7】図4に示す処理における分岐に用いるプログラ
ムルーチンの一例を示す図である。
FIG. 7 is a diagram showing an example of a program routine used for branching in the processing shown in FIG. 4;

【符号の説明】[Explanation of symbols]

10…ICカード 11…I/O装置 12…CPU 13…RAM 14…ROM 15…EEPROM 20…リーダライタ装置 DESCRIPTION OF SYMBOLS 10 ... IC card 11 ... I / O device 12 ... CPU 13 ... RAM 14 ... ROM 15 ... EEPROM 20 ... Reader / writer device

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平4−77820(JP,A) 特開 昭61−204737(JP,A) 特開 平2−28766(JP,A) 特開 平5−108568(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06K 19/07 G06F 9/06 410 G06F 15/00 310 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-4-77820 (JP, A) JP-A-61-204737 (JP, A) JP-A-2-28766 (JP, A) JP-A-5-204 108568 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06K 19/07 G06F 9/06 410 G06F 15/00 310

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 外部から与えられる複数の命令コードの
それぞれに対応した所定の仕事を実行するCPUを内蔵
した情報記録媒体において、各仕事に共通した共通処理を行うための共通処理プログ
ラムと、各仕事ごとに別々な固有処理を行うための固有
処理プログラムと、をそれぞれ独立して格納したプログ
ラム格納用メモリと、 複数の命令コードについて、それぞれ使用頻度順に連続
した番号からなる命令番号を対応づける命令番号テーブ
ルと、 各命令番号に対して、それぞれ分岐先となる固有処理プ
ログラムのアドレスを対応づけるアドレステーブルと、 外部から所定の命令コードが与えられたときに、前記命
令番号テーブルを使用頻度の高い方から順に参照するこ
とにより対応する命令番号を求め、この命令番号を一時
記憶する準備処理を実行した後、前記共通処理プログラ
ムと前記固有処理プログラムとを所定の順序で実行する
機能を有し、かつ、前記固有処理プログラムを実行する
際には、前記アドレステーブルを参照することにより、
記憶した命令番号に対応するアドレスを求め、このアド
レス先の固有処理プログラムを選択的に実行する機能を
有する処理実行部と、 を備えることを特徴とするCPUを内蔵した情報記録媒
体。
1. A common processing program for performing common processing common to each task on an information recording medium incorporating a CPU for executing a predetermined task corresponding to each of a plurality of instruction codes given from outside.
Ram and unique to perform separate unique processing for each job
Processing programs and programs that store
RAM storage memory and multiple instruction codes, each successive in frequency of use
Instruction number table that associates instruction numbers consisting of
For each instruction number, the specific processing
An address table for associating program addresses, and when a predetermined instruction code is given from outside, the instruction
Refer to the order number table in descending order of frequency of use.
And obtain the corresponding instruction number, and temporarily store this instruction number.
After executing the preparatory processing for storing, the common processing program is executed.
And the specific processing program are executed in a predetermined order.
Having a function and executing the unique processing program
In this case, by referring to the address table,
Find the address corresponding to the stored instruction number, and
Function to selectively execute the destination specific processing program
Information recording medium which incorporates a processing execution section, a CPU, characterized in that it comprises a having
body.
【請求項2】 請求項1に記載の情報記録媒体におい
て、処理実行部が、命令番号に関するインクリメント処理も
しくはデクリメント処理を行うたびに、アドレステーブ
ル内の1つのアドレスを指し示すポインタを移動させる
処理を行い、前記インクリメント処理もしくはデクリメ
ント処理の結果が所定の値に達したときに前記ポインタ
によって指し示されていたアドレス先の固有処理プログ
ラムを選択的に実行することを特徴とするCPUを内蔵
した情報記録媒体。
2. The information recording medium according to claim 1, wherein the processing execution unit performs an increment process on the instruction number.
Or every time the decrement process is performed, the address table
Move pointer pointing to one address in file
Perform the above processing, and perform the increment processing or decrement
When the result of the print processing reaches a predetermined value, the pointer
Specific processing program of the address destination pointed to by
Built-in CPU characterized by selectively executing RAM
Information recording medium.
JP08933093A 1993-03-24 1993-03-24 Information recording medium with built-in CPU Expired - Lifetime JP3231467B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP08933093A JP3231467B2 (en) 1993-03-24 1993-03-24 Information recording medium with built-in CPU

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP08933093A JP3231467B2 (en) 1993-03-24 1993-03-24 Information recording medium with built-in CPU

Publications (2)

Publication Number Publication Date
JPH06282700A JPH06282700A (en) 1994-10-07
JP3231467B2 true JP3231467B2 (en) 2001-11-19

Family

ID=13967677

Family Applications (1)

Application Number Title Priority Date Filing Date
JP08933093A Expired - Lifetime JP3231467B2 (en) 1993-03-24 1993-03-24 Information recording medium with built-in CPU

Country Status (1)

Country Link
JP (1) JP3231467B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002501269A (en) * 1998-01-22 2002-01-15 モンデックス インターナショナル リミテッド Codelet
JP4747450B2 (en) * 2001-07-12 2011-08-17 大日本印刷株式会社 Portable information processing device
FR2835628A1 (en) * 2002-02-01 2003-08-08 Schlumberger Systems & Service MANAGEMENT OF THE UPDATE OF INFORMATION ENCODED IN MEMORY
JP2016120552A (en) * 2014-12-24 2016-07-07 株式会社アイエイアイ Program, and generation method of software
JP6904286B2 (en) * 2018-03-13 2021-07-14 大日本印刷株式会社 Electronic information storage medium and IC card

Also Published As

Publication number Publication date
JPH06282700A (en) 1994-10-07

Similar Documents

Publication Publication Date Title
KR950007895B1 (en) Portable electronic apparatus
US6785808B2 (en) System and method for altering an operating system start-up sequence prior to operating system loading
CN101061466B (en) Apparatus and method for processing data of flash memory
JPH03250499A (en) Data storage circuit
Shaw et al. A command structure for complex information processing
EP0902364A1 (en) Method for loading a program
JP3231467B2 (en) Information recording medium with built-in CPU
US6286757B1 (en) Portable electronic apparatus
US7237092B2 (en) Microprocessor circuit for portable data carriers and method for operating the circuit
US6301622B1 (en) Computer system having identification data and method for transferring identification data to computer
JP3512252B2 (en) Information recording medium with built-in CPU
US7302550B1 (en) Stack of variable length operands and method for use
JPH0935019A (en) Portable information recording medium and its access method
JP4747450B2 (en) Portable information processing device
TWI239477B (en) Processor and method for processing a program with comments and medium with a computer program
JPH09106376A (en) Portable information recording medium
US20070145157A1 (en) Recording method, recorder and IC card
JP3471838B2 (en) How to manage circular sequential files
JP2850049B2 (en) IC card
JPH06309525A (en) Information recording medium with built-in cpu
JP2001356916A (en) Memory blocking compiler and program executing method
JP3390207B2 (en) Information recording medium with built-in CPU
JPH02165358A (en) Program loading system with learning function
JPH04205694A (en) Electronic device provided with information storage device
JPH01103720A (en) Key input device

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080914

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090914

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090914

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100914

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110914

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110914

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120914

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120914

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130914

Year of fee payment: 12