Patent ID: 8469278

Claim:
An information storage medium formed of a card main body having a module embedded therein, wherein the module comprises: communicating means for receiving a command from an external device; storing means for storing a plurality of data processing routines each including at least one check point; and data processing means for executing processing corresponding to the command in accordance with the plurality of data processing routines including a predetermined data processing routine, storing respective check flags having values that vary in accordance with use of the respective check points included the respective data processing routines, storing a dedicated check flag having a value that changes based on a call for the predetermined data processing routine, and confirming validity of data processing by comparing the values of the stored check flags and the dedicated check flag with a predetermined expected value, wherein the storing means stores a sub-routine in the lowermost layer, a sub-routine in an intermediate layer including the subroutine in the lowermost layer, and a main routine including the sub-routine in the intermediate layer, and wherein the data processing means executes data processing corresponding to the command in accordance with the main routine, the sub-routine in the intermediate layer, and the sub-routine in the lowermost layer, stores dedicated check flag having the value that changes based on the call for the sub-routine in the lowermost layer, and confirms validity of data processing by comparing the value of the stored check flag with the predetermined expected value.