JPH103526A - IC card - Google Patents
IC cardInfo
- Publication number
- JPH103526A JPH103526A JP8153563A JP15356396A JPH103526A JP H103526 A JPH103526 A JP H103526A JP 8153563 A JP8153563 A JP 8153563A JP 15356396 A JP15356396 A JP 15356396A JP H103526 A JPH103526 A JP H103526A
- Authority
- JP
- Japan
- Prior art keywords
- program
- cpu
- card
- stored
- application program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
(57)【要約】
【課題】 使用しているCPUによらず、所定言語によ
り記述されたアプリケーション・プログラムを導入する
ことが可能であるICカードを提供する。
【解決手段】 CPU(18)と、前記CPUが実行可
能な汎用プログラムを格納する読み出し専用メモリ(1
2)と、前記CPUが実行可能なアプリケーション・プ
ログラムを必要に応じて格納される書き換え可能な不揮
発性メモリ(16)とを備えるICカードにおいて、前
記読み出し専用メモリは、所定言語により記述されたプ
ログラムを前記CPUが実行可能な言語により記述され
たプログラムに変換する言語変換プログラムを有し、前
記CPUは、外部より与えられたアプリケーション・プ
ログラムを前記言語変換プログラムを用いて変換し、前
記不揮発性メモリに格納する。
(57) [Problem] To provide an IC card into which an application program described in a predetermined language can be introduced irrespective of a CPU used. A CPU (18) and a read-only memory (1) for storing a general-purpose program executable by the CPU.
2) and an IC card comprising a rewritable nonvolatile memory (16) for storing an application program executable by the CPU as necessary, wherein the read-only memory is a program described in a predetermined language. Has a language conversion program for converting a program written in a language executable by the CPU, the CPU converts an externally applied application program using the language conversion program, To be stored.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、不揮発性メモリに
アプリケーション・プログラムを格納することが可能な
ICカードに関するものである。The present invention relates to an IC card capable of storing an application program in a nonvolatile memory.
【0002】[0002]
【従来の技術】ICカードは、磁気カードに代わる新し
い情報記憶媒体として、近年注目を集めている。特に、
CPUを内蔵したICカードは、高度なセキュリティを
実現できることから、高度情報化社会の種々の分野にお
いて利用されることが期待されている。2. Description of the Related Art In recent years, an IC card has attracted attention as a new information storage medium replacing a magnetic card. Especially,
Since an IC card with a built-in CPU can realize high security, it is expected to be used in various fields of the advanced information society.
【0003】一般にICカードは、ROM、RAM、E
EPROMの3種類のメモリと、それらメモリにアクセ
スするCPUとを備えている。EEPROMは、書換え
可能な不揮発性メモリであり、ICカードユーザの個人
情報等のデータが保存される。RAMは、CPUがプロ
グラムを実行するときに作業領域として使用する揮発性
のメモリである。ROMは、読み出し専用メモリであ
り、CPUが実行すべきプログラムが格納されている。In general, IC cards are ROM, RAM, E
It has three types of memories of the EPROM and a CPU for accessing these memories. The EEPROM is a rewritable nonvolatile memory in which data such as personal information of an IC card user is stored. The RAM is a volatile memory used as a work area when the CPU executes a program. The ROM is a read-only memory and stores a program to be executed by the CPU.
【0004】ROMが格納するプログラムは、ICカー
ドの用途ごとに異なる。したがって、ICカードの用途
が多種多様化すると、それだけ多くの種類のROMを用
意することとなる。しかし、一般にROMは、その開発
に多大の費用を必要とする。このために、ICカードの
用途の多様化に合わせ、ROMを多品種少量生産するこ
ととすれば、ROMの単価が上がり、ICカードの製造
原価が増大する。The programs stored in the ROM differ depending on the use of the IC card. Therefore, as the uses of IC cards become more diverse, more types of ROMs will be prepared. However, ROM generally requires a great deal of expense for its development. For this reason, if ROMs are produced in various types and in small quantities in accordance with the diversification of uses of IC cards, the unit price of ROMs increases and the manufacturing cost of IC cards increases.
【0005】上記の問題に対し、従来ROMに格納され
ていたプログラムを2種類に大別し、一方をROMに、
他方をEEPROMに格納するICカードが提案されて
いる。ここで、2種類のプログラムの一方は、ICカー
ドの用途によらず汎用的に使用できるプログラム(以下
「汎用プログラム」という)である。また、他方は、I
Cカードの各種用途固有の処理を行うプログラム(以下
「アプリケーション・プログラム」という)である。[0005] To solve the above problem, programs conventionally stored in ROM are roughly classified into two types, one of which is stored in ROM,
An IC card that stores the other in an EEPROM has been proposed. Here, one of the two types of programs is a program that can be used for general purposes regardless of the use of the IC card (hereinafter, referred to as a “general purpose program”). The other is I
This is a program (hereinafter, referred to as an “application program”) that performs processing specific to various uses of the C card.
【0006】上記のICカードでは、全用途のICカー
ドについて、同一のROMを使用することとなるので、
安価なROMを用いた安価なICカードが生産される。
一方、ICカードのEEPROMには、各用途に対応し
たアプリケーション・プログラムが書き込まれることか
ら、用途に応じた木目細かい処理を行うICカードを提
供することが可能となっている。In the above-mentioned IC card, the same ROM is used for the IC card for all uses.
An inexpensive IC card using an inexpensive ROM is produced.
On the other hand, since an application program corresponding to each application is written in the EEPROM of the IC card, it is possible to provide an IC card that performs fine-grained processing according to the application.
【0007】[0007]
【発明が解決しようとする課題】しかし、前述した従来
のICカードでは、全ての種類のICカードについて、
同一種類のCPUが使用されている分けではなく、IC
カードの製造メーカごとに、異なる種類のCPUが使用
されている。一方、CPUは、各種類ごとに解釈実行で
きるプログラム言語が異なる。したがって、ICカード
に格納するプログラムは、使用されているCPUに対応
したプログラム言語により作成されなければならない。
このために、従来のICカードでは、例え同一内容のア
プリケーション・プログラムであっても、ICカードの
種類ごとに、それぞれのCPUにあったプログラム言語
を用いて別々に製作しなければならず、作業が大変煩雑
であるという問題があった。However, in the above-mentioned conventional IC card, all kinds of IC cards are required.
It is not a division that uses the same type of CPU.
Different types of CPUs are used for different card manufacturers. On the other hand, the CPU can interpret and execute different program languages for each type. Therefore, the program to be stored in the IC card must be created in a programming language corresponding to the CPU being used.
For this reason, in the conventional IC card, even if the application program has the same contents, it must be separately manufactured for each type of IC card using a programming language suitable for each CPU. However, there is a problem that it is very complicated.
【0008】そこで、本発明の第1の課題は、使用して
いるCPUによらず、所定言語により記述されたアプリ
ケーション・プログラムを導入することが可能であるI
Cカードを提供することである。[0008] Therefore, a first object of the present invention is to enable an application program written in a predetermined language to be introduced irrespective of the CPU used.
To provide a C card.
【0009】[0009]
【課題を解決するための手段】前記課題を解決するため
に、請求項1に係る発明は、CPU(18)と、前記C
PUが実行可能な汎用プログラムを格納する読み出し専
用メモリ(12)と、前記CPUが実行可能なアプリケ
ーション・プログラムを必要に応じて格納される書き換
え可能な不揮発性メモリ(16)とを備えるICカード
において、前記読み出し専用メモリは、所定言語により
記述されたプログラムを前記CPUが実行可能な言語に
より記述されたプログラムに変換する変換プログラムを
有し、前記CPUは、外部より与えられたアプリケーシ
ョン・プログラムを前記変換プログラムを用いて変換
し、前記不揮発性メモリに格納することを特徴とする。In order to solve the above-mentioned problems, the invention according to claim 1 comprises a CPU (18) and the CPU (18).
An IC card comprising: a read-only memory (12) storing a general-purpose program executable by a PU; and a rewritable nonvolatile memory (16) storing an application program executable by the CPU as necessary. The read-only memory has a conversion program that converts a program written in a predetermined language into a program written in a language executable by the CPU, and the CPU executes an externally supplied application program. The data is converted using a conversion program and stored in the nonvolatile memory.
【0010】請求項2に係る発明は、CPU(18)
と、前記CPUが実行可能な汎用プログラムを格納する
読み出し専用メモリ(12)と、前記CPUが実行すべ
きアプリケーション・プログラムを必要に応じて格納さ
れる書き換え可能な不揮発性メモリ(16)とを備える
ICカードにおいて、前記読み出し専用メモリは、所定
言語により記述されたプログラムを前記CPUが実行可
能な言語により記述されたプログラムに変換する変換プ
ログラムを有し、前記CPUは、前記不揮発性メモリに
格納されている前記アプリケーション・プログラムを前
記変換プログラムを用いて変換して実行することを特徴
とする。According to a second aspect of the present invention, a CPU (18)
A read-only memory (12) for storing a general-purpose program executable by the CPU; and a rewritable nonvolatile memory (16) for storing an application program to be executed by the CPU as necessary. In the IC card, the read-only memory has a conversion program for converting a program written in a predetermined language into a program written in a language executable by the CPU, and the CPU is stored in the nonvolatile memory. And converting and executing the application program using the conversion program.
【0011】[0011]
【発明の実施の形態】以下、図面等を参照して、本発明
に係る一実施形態について、さらに詳しく説明する。図
1は、本発明に係るICカードの構成を示す図である。
図1に示されるように、ICカード10は、読み出し専
用メモリであるROM12、揮発性メモリであるRAM
14、随時書換え可能な不揮発性メモリのEEPROM
16及びそれらメモリにアクセスするCPU18を備え
ている。Hereinafter, an embodiment of the present invention will be described in more detail with reference to the drawings. FIG. 1 is a diagram showing a configuration of an IC card according to the present invention.
As shown in FIG. 1, an IC card 10 includes a ROM 12 that is a read-only memory and a RAM that is a volatile memory.
14. Non-volatile memory EEPROM that can be rewritten at any time
16 and a CPU 18 for accessing these memories.
【0012】また、ICカード10は、リーダ・ライタ
(不図示)と電気信号等の授受を行うための複数の接点
(Vcc〜GND)を備えている。ICカードをリーダ
・ライタに挿入すると、リーダ・ライタの接点がこのI
Cカードの接点と接続され、電気信号の授受が行われ
る。各接点には、それぞれ異なる電気信号が割り付けら
れている。例えば、VccはICが動作するために必要
な電源電圧の供給を受けるための接点であり、I/0
は、CPUがリーダ・ライタと通信を行うための接点
(シリアルポート)である。The IC card 10 has a plurality of contacts (Vcc to GND) for exchanging electric signals and the like with a reader / writer (not shown). When the IC card is inserted into the reader / writer, the contacts of the reader / writer
It is connected to the contacts of the C card, and exchanges electrical signals. Different electrical signals are assigned to the respective contacts. For example, Vcc is a contact for receiving supply of a power supply voltage required for operating the IC, and I / O
Is a contact (serial port) for the CPU to communicate with the reader / writer.
【0013】CPU18は、上記接点を介してリーダ・
ライタからコマンド付与され、そのコマンドに従いRO
M12又はEEPROM16に格納されているプログラ
ムを実行し、その結果、EEPROM16等にアクセス
する。本実施形態では、CPU18が実行すべきコマン
ドを前述した汎用プログラムとアプリケーション・プロ
グラムとに分割し、汎用プログラムをROM12に、ア
プリケーション・プログラムをEEPROM16に格納
することとしている。The CPU 18 is connected to a reader / writer via the contact.
A command is given from the writer, and RO is issued according to the command.
M12 or the program stored in the EEPROM 16 is executed, and as a result, the EEPROM 16 or the like is accessed. In the present embodiment, the command to be executed by the CPU 18 is divided into the above-described general-purpose program and the application program, and the general-purpose program is stored in the ROM 12 and the application program is stored in the EEPROM 16.
【0014】図2は、RAM14とEEPROM16の
メモリマップを示す図である。なお、本明細書において
数値の前に付されている「H’」は、その数値が16進
数に基づいて表記されていることを意味する。本実施形
態では、RAM14に絶対アドレスでH’100〜H’
12Fを、論理アドレスでR00〜R2Fを割り当てて
いる。また、EEPROM16には、絶対アドレスで
H’200以降のアドレスを割り当てている。図2で
は、一例として、EEPROM16に2つのアプリケー
ション・プログラムが格納されている場合を示してい
る。第1のアプリケーション・プログラムは、絶対アド
レスでH’200〜H’27Fに格納されており、第2
のアプリケーション・プログラムは、H’280以降に
格納されている。FIG. 2 is a diagram showing a memory map of the RAM 14 and the EEPROM 16. Note that, in this specification, “H ′” added before a numerical value means that the numerical value is represented based on a hexadecimal number. In the present embodiment, H'100 to H 'are stored in the RAM 14 as absolute addresses.
12F is assigned to R00 to R2F by a logical address. The EEPROM 16 is assigned an absolute address of H'200 or later. FIG. 2 shows a case where two application programs are stored in the EEPROM 16 as an example. The first application program is stored in absolute addresses H'200 to H'27F,
Are stored in H'280 and later.
【0015】EEPROM16に格納されているアプリ
ケーション・プログラムは、6種類の情報から構成され
ている。以下、その6種類の情報について、図2の第1
のアプリケーション・プログラムを用いて説明する。第
1の情報は、「LEN」であり、その後に続いて格納さ
れている第2の情報「APPLICATION ID」
の長さ(バイト数)を示している。第2の情報「APP
LICATION ID」は、アプリケーション・プロ
グラムの識別名である。第3の情報「NextAP a
dd」は、当該アプリケーション・プログラムの次に格
納されている、又は次に格納されるべきアプリケーショ
ン・プログラムの先頭アドレスを示す情報である。ここ
では、第2のアプリケーション・プログラムの先頭アド
レスである「H’280」が格納されている。The application program stored in the EEPROM 16 is composed of six types of information. Hereinafter, the six types of information will be described in the first part of FIG.
A description will be given using the application program of FIG. The first information is "LEN", and the second information "APPLICATION ID" stored subsequently thereto is "LEN".
Indicates the length (number of bytes). The second information "APP
"LICATION ID" is an identification name of the application program. The third information “NextAP a
“dd” is information indicating the start address of the application program stored next to or to be stored next to the application program. Here, "H'280" which is the head address of the second application program is stored.
【0016】「Next AP add」の次に格納さ
れいている「Data add」は、後述するデータ領
域の先頭アドレスを示す情報であり、ここでは「H’2
50」が格納されている。絶対アドレスH’212〜
H’24Fに格納されている第5の情報は、CPU18
が実行可能なプログラム言語による1又は2以上のCP
U命令コード(以下「変換されたCPU命令コード」と
いう)である。最後に、絶対アドレスH’250〜H’
27Fに格納されている第6の情報は、1又は2以上の
データコードである。図に示されるように、データコー
ドが格納されている領域には、絶対アドレスとは別に論
理アドレスE00〜E2Fが割り当てられている。後述
するように、本実施形態のアプリケーション・プログラ
ムでは、この論理アドレスを用いて特定のデータコード
を指定する。"Data add" stored after "Next AP add" is information indicating the start address of a data area to be described later, and is "H'2" here.
50 "is stored. Absolute address H'212 ~
The fifth information stored in H′24F is
One or more CPs in a programming language executable by
U instruction code (hereinafter referred to as “converted CPU instruction code”). Finally, the absolute addresses H'250 to H '
The sixth information stored in 27F is one or more data codes. As shown in the figure, logical addresses E00 to E2F are assigned to the area where the data code is stored, separately from the absolute address. As described later, in the application program of the present embodiment, a specific data code is specified using the logical address.
【0017】図3は、本実施形態の疑似プログラムコー
ド(プログラム言語)により記述されたアプリケーショ
ン・プログラムの一例を示す図である。ここでは、一例
として、図2の第1のアプリケーション・プログラムの
内容を示している。本実施形態では、使用されているC
PU18の種類によらず、全てのICカードについて、
共通の疑似プログラムコードを用いてアプリケーション
・プログラムを製作する。その結果得られたアプリケー
ション・プログラム(以下「疑似プログラム」という)
は、EEPROM16に格納する際に、ROM12の備
える汎用プログラムを用いて、CPU18が実行可能な
プログラム言語に変換される。この点に関しては、図6
の説明において詳述する。FIG. 3 is a diagram showing an example of an application program described in the pseudo program code (program language) of the present embodiment. Here, as an example, the contents of the first application program in FIG. 2 are shown. In the present embodiment, the used C
Regardless of the type of PU18, for all IC cards,
Create an application program using common pseudo-program code. The resulting application program (hereinafter referred to as "pseudo program")
Is stored in the EEPROM 16 and converted into a program language executable by the CPU 18 using a general-purpose program provided in the ROM 12. In this regard, FIG.
Will be described in detail in the description.
【0018】疑似プログラムは、図3に示すように、A
PPLICATION ID、DEFINE SECT
ION、CODE SECTION、及び、DATA
SECTIONの4つのセクションより構成されてい
る。APPLICATION IDは、プログラムの識
別名が記述されるセクションである。図3では、識別名
として「Application01」が使用されてい
る。DEFINE SECTIONは、プログラムで用
いる変数名が定義されるセクションである。DEFIN
E SECTIONの(2)行目は、変数AがRAM1
4の論理アドレスR00から始めるH’2バイトのデー
タであることを示している。同様に、(3)行目は、変
数XがRAM14の論理アドレスR10から始めるH’
10バイトのデータであることを示している。また、
(4)行目及び(5)行目は、変数YがEEPROM1
6の論理アドレスE00から始めるH’10バイトのデ
ータであること、及び、変数ZがEEPROM16の論
理アドレスE20から始めるH’10バイトのデータで
あることを示している。The pseudo program is, as shown in FIG.
PPLICATION ID, DEFINE SECT
ION, CODE SECTION, and DATA
It is composed of four sections of SECTION. APPLICATION ID is a section in which the identification name of the program is described. In FIG. 3, “Application01” is used as the identification name. DEFINE SECTION is a section in which variable names used in the program are defined. DEFIN
In line (2) of E SECTION, the variable A
4 indicates that the data is H'2 byte data starting from the logical address R00. Similarly, in line (3), the variable X is H ′ starting from the logical address R10 of the RAM 14.
It indicates that the data is 10 bytes. Also,
In line (4) and line (5), the variable Y is the EEPROM1
6 indicates that the data is H'10-byte data starting from the logical address E00, and that the variable Z is H'10-byte data starting from the logical address E20 of the EEPROM 16.
【0019】CODE SECTIONは、CPU18
によって実行されるべきプログラムの部分である。本セ
クションの(6)行目は、論理アドレスE00からH’
10バイトのデータを読みとり、これを論理アドレスR
00から始まるH’10バイトの領域に書き込むべきこ
とを意味している。(7)行目は、論理アドレスR00
から始まるH’10バイトのデータを読みとり、これを
論理アドレスE20から始まるH’10バイトの領域に
書き込むべきことを意味している。(8)行目は、論理
アドレスR00から始まるH’2バイトの領域に固定値
9000をセットすべきことを意味している。また、
(9)行目は、論理アドレスR00から始まるH’2バ
イトデータをレスポンスデータとしてROM12の汎用
プログラムに引き渡すべきことを意味している。最後
に、DATA SECTIONは、本アプリケーション
・プログラムが有するデータが記載されているセクショ
ンである。The CODE SECTION is the CPU 18
Part of the program to be executed by Line (6) of this section is from logical address E00 to H ′
10-byte data is read, and this is read as the logical address R
This means that data should be written to the H'10-byte area starting from 00. (7) The line is the logical address R00
This means that H'10-byte data starting from the logical address E20 should be read and written to the H'10-byte area starting from the logical address E20. Line (8) means that a fixed value 9000 should be set in the H'2 byte area starting from the logical address R00. Also,
The line (9) means that H'2 byte data starting from the logical address R00 should be delivered to the general-purpose program in the ROM 12 as response data. Finally, the DATA SECTION is a section in which data of the application program is described.
【0020】図4は、本実施形態固有のコマンドである
Store Applicationコマンド及びSe
lect Applicationコマンドのフォーマ
ットを示す図である。Store Applicati
onコマンドは、疑似プログラムをEEPROM16に
格納するためのコマンドである。Store Appl
icationコマンドの第1バイト目は、このコマン
ド識別するための種別コード(以下「INS」という)
である。本実施形態では、Store Applica
tionコマンドの種別コードとして例えば「01」を
割り当てている。第2バイト目以降は、EEPROM1
6に格納するべき疑似プログラムである。FIG. 4 shows a Store Application command and a Se which are commands unique to this embodiment.
FIG. 14 is a diagram illustrating a format of a select Application command. Store Applicati
The on command is a command for storing the pseudo program in the EEPROM 16. Store Appl
The first byte of the iication command is a type code for identifying the command (hereinafter referred to as “INS”).
It is. In the present embodiment, Store Applica
For example, “01” is assigned as the type code of the “tion” command. From the second byte onwards, EEPROM1
6 is a pseudo program to be stored.
【0021】Select Applicationコ
マンドは、EEPROM16に格納されている特定のア
プリケーション・プログラムを選択するためのコマンド
である。Selectコマンドは、3種類の情報から構
成されている。第1バイト目は、Store Appl
icationコマンドと同様にINSである。本実施
形態では、Select Applicationコマ
ンドのINSとして例えば「02」を割り当てている。
また、Select Applicationコマンド
の第2バイト目以降には、実行すべきアプリケーション
・プログラムのLENとApplication ID
とが順に配置されている。The Select Application command is a command for selecting a specific application program stored in the EEPROM 16. The Select command is composed of three types of information. The first byte is Store Appl
This is INS as in the case of the ication command. In the present embodiment, for example, “02” is assigned as the INS of the Select Application command.
The second and subsequent bytes of the Select Application command include the LEN of the application program to be executed and the Application ID.
Are arranged in order.
【0022】図5から図7までは、ROM12に格納さ
れている汎用プログラムの流れ図である。以下、これら
の図を用いて、ICカード10の動作について説明す
る。ICカード10とリーダ・ライタとが接続され、リ
ーダ・ライタによりICカードがリセット(活性化)さ
れると、CPU18は、まず初期応答情報(ATR)を
レスポンスとして出力する(S502)。次に、CPU
18は、リーダ・ライタからのコマンド待ち状態となる
(S504、S506)。FIGS. 5 to 7 are flowcharts of general-purpose programs stored in the ROM 12. Hereinafter, the operation of the IC card 10 will be described with reference to these drawings. When the IC card 10 is connected to the reader / writer and the IC card is reset (activated) by the reader / writer, the CPU 18 first outputs initial response information (ATR) as a response (S502). Next, CPU
18 is in a state of waiting for a command from the reader / writer (S504, S506).
【0023】リーダ・ライタからのコマンドを受信する
と(S506:Yes)、CPU18は、そのコマンド
の第1バイト目であるINSの値を確認する(S50
6、S510)。この結果、INSが「01」又は「0
2」のいずれでもない場合には、S512へ進み、すで
にSelect Applicationコマンドが処
理され、所定のアプリケーション・プログラムが選択済
みであるか否かが判断される。具体的には、RAM14
の所定領域に、Select Application
コマンドを処理することにより特定された、アプリケー
ション・プログラムのアドレスが存在するか否かが判断
される。When a command is received from the reader / writer (S506: Yes), the CPU 18 checks the value of INS which is the first byte of the command (S50).
6, S510). As a result, INS becomes “01” or “0”.
If not, the process proceeds to S512, in which the Select Application command is already processed, and it is determined whether or not a predetermined application program has been selected. Specifically, the RAM 14
Select Application in a predetermined area
It is determined whether the address of the application program specified by processing the command exists.
【0024】S512において、アプリケーション・プ
ログラムが選択済みであると判断されると、当該アプリ
ケーション・プログラムが実行される(S516)。一
方、S512において、アプリケーション・プログラム
が選択されていないと判断されると、コマンド・エラー
・ステータスがRAM14の所定領域にレスポンス情報
として編集される(S514)。S514又は516の
処理が終了すると、RAM14の所定領域に編集された
レスポンス情報は、リーダ・ライタに送信される(S5
18)。レンスポンス情報が送信された後は、再びS5
04に戻り、S518までの処理が繰り返される。If it is determined in S512 that the application program has been selected, the application program is executed (S516). On the other hand, if it is determined in S512 that the application program has not been selected, the command error status is edited in a predetermined area of the RAM 14 as response information (S514). When the processing of S514 or 516 is completed, the response information edited in the predetermined area of the RAM 14 is transmitted to the reader / writer (S5).
18). After the response information is transmitted, S5 is performed again.
04, and the processing up to S518 is repeated.
【0025】一方、S508においてINSが「01」
であった場合には、コマンドがStore Appli
cationコマンドであると判断され、S510から
S516までの処理の代わりに、図6のS602からS
616までの処理が実行される。以下、S602からS
616までの処理について、未だ何らのプログラム又は
データが格納されていないEEPROM16に、図3に
示した疑似プログラムを格納する場合を例として説明す
る。On the other hand, in S508, INS is "01".
If the command is Store Appli
It is determined that the received command is an operation command from S602 to S516 in FIG. 6 instead of the processing from S510 to S516.
The processing up to 616 is executed. Hereinafter, from S602 to S
The processing up to 616 will be described as an example in which the pseudo program shown in FIG. 3 is stored in the EEPROM 16 in which no program or data is stored yet.
【0026】まず、S602では、Store App
licationコマンドにより送られてきた疑似プロ
グラムの中で、「APPLICATION ID:」か
らその後に「;」が現れるまで間に存在するデータの長
さが求められ、その結果がEEPROM16のH’20
0番地に書き込まれる(S602)。次に、「APPL
ICATION ID:」からその後に「;」が現れる
までのデータ、すなわちアプリケーション・プログラム
の識別名「APPLICATION01」がアドレス
H’201〜H’20Dに書き込まれる。First, in S602, Store App
The length of data existing from “APPLICATION ID:” to the subsequent appearance of “;” in the pseudo program sent by the “location” command is obtained, and the result is stored in H′20 of the EEPROM 16.
It is written to address 0 (S602). Next, "APPL
The data from "ICATION ID:" to the appearance of ";", that is, the application program identification name "APPLICATION01" is written to the addresses H'201 to H'20D.
【0027】次に、「DEFINE SECTIO
N:」及び「CODE SECTION:」以降に定義
されている疑似プログラムの内容が、CPU18が実行
可能なCPU命令コード(プログラム言語)に変換され
る(S606)。S606における疑似プログラムの変
換が正常に終了し、変換されたCPU命令コードが取得
されると、その命令コードは、EEPROM16に書き
込まれる(S608)。書き込むアドレスは、APPL
ICATION IDの最後端アドレスからさらに4バ
イト進めたアドレスからである。これは、この後にS6
10、S614においてNext AP add及びD
ata addを書き込む領域をあらかじめ確保するた
めの処置である。Next, "DEFINE SECTION"
The contents of the pseudo program defined after "N:" and "CODE SECTION:" are converted into CPU instruction codes (program languages) that can be executed by the CPU 18 (S606). When the conversion of the pseudo program in S606 ends normally and the converted CPU instruction code is obtained, the instruction code is written into the EEPROM 16 (S608). Write address is APPL
This is from the address advanced by 4 bytes from the last address of the ICAT ID. This is followed by S6
10. Next AP add and D in S614
This is a process for securing an area for writing the data add in advance.
【0028】S608において変換されたCPU命令コ
ードを書き込む処理が終了すると、その段階で次に「D
ATA SECTION:」を書き込むべき領域の先頭
アドレスが明確となるので、そのアドレス(H’25
0)がDATA add(H’210〜H’211)に
書き込まれる(S610)。また、「DATA SEC
TION:」に定義されているデータ自体がH’250
以降に書き込まれる(S612)。When the process of writing the converted CPU instruction code in S608 is completed, at this stage, "D"
Since the start address of the area where “ATA SECTION:” is to be written is clear, the address (H′25
0) is written to DATA add (H'210 to H'211) (S610). Also, "DATA SEC
TION: ”is H'250.
Thereafter, it is written (S612).
【0029】次に、「DATA SECTION:」の
データが書き込まれた領域の次のアドレスが、次のアプ
リケーション・プログラムを書き込むことが可能な領域
の先頭アドレスとしてNext AP(H’20E〜
H’20F)へ書き込まれる(S614)。最後に、正
常終了ステータスがRAM14の所定アドレスにセット
され(S616)、Store Applicatio
nコマンドの一連の処理は終了する。Next, the next address of the area in which the data of "DATA SECTION:" has been written is the next AP (H'20E ...
H′20F) (S614). Finally, the normal end status is set to a predetermined address of the RAM 14 (S616), and the Store Application is set.
A series of processing of the n command ends.
【0030】一方、図5のS510においてINSが
「02」であった場合には、コマンドがSelect
Applicationコマンドであると判断され、S
510からS516までの処理の代わりに、図7のS7
02からS720までの処理が実行される。On the other hand, if the INS is “02” in S510 of FIG. 5, the command is “Select”.
It is determined that the command is an Application command.
Instead of the processing from 510 to S516, S7 in FIG.
The processing from 02 to S720 is executed.
【0031】S702では、EEPROM16に少なく
とも1つのアプリケーション・プログラムが格納されて
いるか否かが確認される。この結果、EEPROM16
にアプリケーション・プログラムが全く格納されていな
い場合には、S720へ進み、該当するアプリケーショ
ン・プログラムが存在しない旨のエラーステータスをR
AM14の所定アドレスにセットし、Select A
pplicationコマンドの処理を終了する。In S702, it is confirmed whether at least one application program is stored in the EEPROM 16. As a result, the EEPROM 16
If the application program is not stored at all in step S720, the flow advances to step S720 to set an error status indicating that the corresponding application program does not exist in R.
Set to a predetermined address of AM14 and select A
The processing of the application command ends.
【0032】一方、S702においてEEPROM16
にアプリケーション・プログラムが格納されていること
が確認されると、コマンド中のAPPLICATION
IDとEEPROM16の絶対アドレスH’200か
ら始まるAPLICATION IDとが比較される
(S704)。比較の結果、双方のAPPLICATI
ON IDが一致した場合には、そのアプリケーション
・プログラムにおける変換されたCPU命令コードが格
納されている領域の先頭アドレスを求め、これをRAM
14の所定アドレスに格納する(S716)。次に、正
常終了ステータスをRAM14の所定アドレスに格納
し、Select Applicationコマンドの
処理は終了する。On the other hand, in S702, the EEPROM 16
When it is confirmed that the application program is stored in the command, APPLICATION in the command is output.
The ID and the APLICATION ID starting from the absolute address H'200 of the EEPROM 16 are compared (S704). As a result of the comparison, both APPLICATI
If the ON IDs match, the start address of the area where the converted CPU instruction code in the application program is stored is obtained, and this is stored in the RAM.
14 is stored at a predetermined address (S716). Next, the normal end status is stored at a predetermined address in the RAM 14, and the processing of the Select Application command ends.
【0033】一方、S706においてAPPLICAT
ION IDが一致しなかった場合には、Next A
P addの内容を読み取ることにより、次のアプリケ
ーション・プログラムが格納されている領域の先頭アド
レスが取得される(S708)。次に、S708におい
て取得されたアドレスにアプリケーション・プログラム
が格納されいるか否かが確認され、その結果アプリケー
ション・プログラムが格納されていない場合には、S7
20の処理が実行されてSelect Applica
tionコマンドの処理が終了される。On the other hand, in S706, APPLICAT
If the ION IDs do not match, Next A
By reading the contents of Padd, the start address of the area where the next application program is stored is obtained (S708). Next, it is confirmed whether or not the application program is stored at the address obtained in S708. If the result is that no application program is stored, the process proceeds to S7.
20 processing is executed and Select Applica
The processing of the Tion command is terminated.
【0034】一方、S710において次のアプリケーシ
ョン・プログラムが確認された場合には、さらにS71
2に進み、Next AP addが示すApplic
ation IDとコマンド中のApplicatio
n IDが比較される。比較の結果、双方のAppli
cation IDが一致しなかった場合には、S70
8以降の処理が再度実行される。一方、Applica
tion IDが一致した場合には、さらにS716、
S718の処理が実行され、Select Appli
cationコマンドの処理が終了される。On the other hand, if the next application program is confirmed in S710, the process proceeds to S71.
2. Go to Applic indicated by Next AP add
Application ID and Application in command
n IDs are compared. As a result of the comparison, both Appli
If the session IDs do not match, S70
The processes after 8 are executed again. On the other hand, Applica
If the tied IDs match, then S716,
The process of S718 is executed, and the Select Appli
The processing of the Cation command is terminated.
【0035】以上説明したように、本実施形態では、ア
プリケーション・プログラムを疑似プログラムコードを
用いて作成する。作成された疑似プログラムは、ICカ
ード10内において、ROM12が有する汎用プログラ
ムを用いて、CPU18が実行可能なCPU命令コード
に変換され、変換された後にEEPROM16の所定の
領域に格納される。つまり、ROM12は、疑似プログ
ラムコードにより記述されたプログラムを、CPU18
が実行可能な言語により記述されたプログラムに変換す
るプログラムを備えているのである。したがって、疑似
プログラムコードにより記述されているアプリケーショ
ン・プログラムは、使用されているCPUの種類に関わ
らず、全てのICカードに導入することが可能である。
言い換えると、本実施形態において疑似プログラムコー
ドは、異なるCPUを備えるICカードの間で共通に使
用できるプログラム言語として機能しているのである。
この結果、本実施形態では、異なるプログラム言語によ
り記述された複数のアプリケーション・プログラムを用
意することなく、種類の異なる2以上のICカードに同
一内容のアプリケーション・プログラムを導入すること
が可能となっている。As described above, in the present embodiment, the application program is created using the pseudo program code. The created pseudo program is converted into a CPU instruction code executable by the CPU 18 using a general-purpose program included in the ROM 12 in the IC card 10, and after being converted, is stored in a predetermined area of the EEPROM 16. That is, the ROM 12 stores the program described by the pseudo program code in the CPU 18.
Is provided with a program for converting into a program described in an executable language. Therefore, the application program described by the pseudo program code can be installed in all IC cards regardless of the type of CPU used.
In other words, in this embodiment, the pseudo program code functions as a program language that can be commonly used between IC cards having different CPUs.
As a result, in the present embodiment, it is possible to introduce the same application program to two or more different types of IC cards without preparing a plurality of application programs described in different programming languages. I have.
【0036】(その他の実施形態)なお、本発明は、上
記実施形態に限定されるものではない。上記実施形態
は、例示であり、本発明の特許請求の範囲に記載された
技術的思想と実質的に同一な構成を有し、同様な作用効
果を奏するものは、いかなるものであっても本発明の技
術的範囲に包含される。(Other Embodiments) The present invention is not limited to the above embodiment. The above embodiment is an exemplification, and has substantially the same configuration as the technical idea described in the scope of the claims of the present invention. It is included in the technical scope of the invention.
【0037】例えば、アプリケーション・プログラム
を、CPU18が実行可能なCPU命令コードに変換す
る処理は、必ずしも当該プログラムをEEPROM16
へ格納する前でなくてもよい。例えば、疑似プログラム
を直接EEPROM16に格納し、その実行時に、疑似
プログラムを実行可能なCPU命令コードに変換して実
行することであってもよい。For example, the process of converting an application program into a CPU instruction code executable by the CPU 18 does not necessarily involve converting the program into the EEPROM 16
It does not need to be before storing in. For example, the pseudo program may be directly stored in the EEPROM 16, and at the time of execution, the pseudo program may be converted into an executable CPU instruction code and executed.
【0038】なお、本明細書において、「ICカード」
とは、CPUと、このCPUによってアクセスされるメ
モリとを備え、CPUは、そのメモリに格納されている
プログラムにしたがい動作する携帯可能な情報記録媒体
を意味する。したがって、「ICカード」は、例えばそ
の形状が平面的かつ四角形であるいわゆるカード状に限
定されるものではなく、コイン形状等の媒体にCPU及
びメモリを備えたものであってもよい。In this specification, the term “IC card” is used.
Means a portable information recording medium including a CPU and a memory accessed by the CPU, the CPU operating according to a program stored in the memory. Therefore, the "IC card" is not limited to, for example, a so-called card shape having a planar and square shape, but may be a medium having a coin shape or the like and having a CPU and a memory.
【0039】[0039]
【発明の効果】以上詳しく説明したように、請求項1又
は請求項2に係る発明によれば、読み出し専用メモリに
所定言語により記述されたプログラムをCPUが実行可
能な言語により記述されたプログラムに変換する変換プ
ログラムを備えることとしたので、1の言語で記述され
たアプリケーション・プログラムを異なるCPUを備え
る2種類以上のICカードに導入することが可能となっ
た。As described above, according to the first or second aspect of the present invention, a program described in a predetermined language in a read-only memory is converted into a program described in a language executable by a CPU. Since a conversion program for conversion is provided, application programs written in one language can be introduced into two or more types of IC cards having different CPUs.
【図1】本発明に係るICカードの構成を示す図であ
る。FIG. 1 is a diagram showing a configuration of an IC card according to the present invention.
【図2】RAM14とEEPROM16のメモリマップ
を示す図である。FIG. 2 is a diagram showing a memory map of a RAM 14 and an EEPROM 16;
【図3】疑似プログラムコードにより記述されたアプリ
ケーション・プログラムを示す図である。FIG. 3 is a diagram showing an application program described by a pseudo program code.
【図4】Store Applicationコマンド
及びSelect Applicationコマンドの
フォーマットを示す図である。FIG. 4 is a diagram illustrating a format of a Store Application command and a Select Application command.
【図5】ROM12に格納されている汎用プログラムの
流れ図である。FIG. 5 is a flowchart of a general-purpose program stored in a ROM 12;
【図6】ROM12に格納されている汎用プログラムの
うち、Store Applicationコマンドの
処理内容を示す流れ図である。FIG. 6 is a flowchart showing processing contents of a Store Application command among general-purpose programs stored in a ROM 12;
【図7】ROM12に格納されている汎用プログラムの
うち、Select Applicationコマンド
の処理内容を示す流れ図である。FIG. 7 is a flowchart showing processing contents of a Select Application command among general-purpose programs stored in a ROM 12;
10 ICカード 12 ROM 14 RAM 16 EEPROM 18 CPU 10 IC card 12 ROM 14 RAM 16 EEPROM 18 CPU
Claims (2)
出し専用メモリと、 前記CPUが実行可能なアプリケーション・プログラム
を必要に応じて格納される書き換え可能な不揮発性メモ
リとを備えるICカードにおいて、 前記読み出し専用メモリは、所定言語により記述された
プログラムを前記CPUが実行可能な言語により記述さ
れたプログラムに変換する変換プログラムを有し、 前記CPUは、外部より与えられたアプリケーション・
プログラムを前記変換プログラムを用いて変換し、前記
不揮発性メモリに格納することを特徴とするICカー
ド。1. A CPU, a read-only memory storing a general-purpose program executable by the CPU, and a rewritable nonvolatile memory storing an application program executable by the CPU as necessary. In the IC card, the read-only memory has a conversion program that converts a program described in a predetermined language into a program described in a language executable by the CPU.
An IC card which converts a program using the conversion program and stores the converted program in the nonvolatile memory.
プログラムを格納する読み出し専用メモリと、 前記CPUが実行すべきアプリケーション・プログラム
を必要に応じて格納される書き換え可能な不揮発性メモ
リとを備えるICカードにおいて、 前記読み出し専用メモリは、所定言語により記述された
プログラムを前記CPUが実行可能な言語により記述さ
れたプログラムに変換する変換プログラムを有し、 前記CPUは、前記不揮発性メモリに格納されている前
記アプリケーション・プログラムを前記変換プログラム
を用いて変換して実行することを特徴とするICカー
ド。2. A CPU, a read-only memory storing a general-purpose program executable by the CPU, and a rewritable nonvolatile memory storing an application program to be executed by the CPU as necessary. In the IC card, the read-only memory has a conversion program for converting a program described in a predetermined language into a program described in a language executable by the CPU, wherein the CPU is stored in the nonvolatile memory. Wherein the application program is converted and executed using the conversion program.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8153563A JPH103526A (en) | 1996-06-14 | 1996-06-14 | IC card |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8153563A JPH103526A (en) | 1996-06-14 | 1996-06-14 | IC card |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH103526A true JPH103526A (en) | 1998-01-06 |
Family
ID=15565240
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP8153563A Pending JPH103526A (en) | 1996-06-14 | 1996-06-14 | IC card |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH103526A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006503349A (en) * | 2002-07-26 | 2006-01-26 | ギーゼッケ ウント デフリエント ゲーエムベーハー | How to install a file system on a data carrier |
-
1996
- 1996-06-14 JP JP8153563A patent/JPH103526A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006503349A (en) * | 2002-07-26 | 2006-01-26 | ギーゼッケ ウント デフリエント ゲーエムベーハー | How to install a file system on a data carrier |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3480746B2 (en) | Portable electronic devices | |
| JPH06302180A (en) | Data access system for electronic device | |
| US20080114935A1 (en) | Memory Card System and Method Transmitting Host Identification Information Thereof | |
| KR100350972B1 (en) | Computer system and method possessing the function of storing an ID in its ROM | |
| TW584865B (en) | Semiconductor memory device and information device | |
| JPH103526A (en) | IC card | |
| JP5537036B2 (en) | IC card | |
| JP3718564B2 (en) | IC card | |
| JP4590201B2 (en) | Data carrier and data carrier program | |
| KR20060129804A (en) | Flash memory device having an MC interface and a memory system including the same | |
| JP3512252B2 (en) | Information recording medium with built-in CPU | |
| CN102132250A (en) | Method of managing data in a portable electronic device having a plurality of controllers | |
| JPH1040350A (en) | IC card and command execution method | |
| JP3764206B2 (en) | IC card, program introduction method and program execution method | |
| JPH0435780B2 (en) | ||
| JPH103385A (en) | IC card and application program introduction method | |
| JP4211890B2 (en) | How to change memory card data in a transaction | |
| JP4342629B2 (en) | Portable electronic device, file control information storage method, and file control information search method | |
| JPH09231113A (en) | IC card | |
| JP2004348342A (en) | IC card and IC card processing method | |
| US20070162699A1 (en) | Apparatus for expanding storage capacity of memory card and operating method of memory card with the same | |
| JPH103525A (en) | IC card, instruction code storage method, and instruction code execution method | |
| JP7284796B2 (en) | Secure memory card and its control method | |
| JP7438432B1 (en) | Electronic information storage medium, IC chip, IC card, record writing method, and program | |
| JP7468757B1 (en) | ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RESPONSE TRANSMISSION METHOD, AND PROGRAM |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050706 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050920 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20060131 |