| C H A P T E R 10 |
|
Producing a Mask File from Java Card Assembly Files |
This chapter describes how to use the maskgen tool to create a mask from Java Card Assembly files. The maskgen tool is not available or of use outside of a source release bundle, so you can disregard this chapter if you do not have a source release of the development kit. If you have a source release, you can localize locale-specific data associated with the maskgen tool, see Chapter 14.
The maskgen tool produces a mask file from a set of Java Card Assembly files produced by the Converter. The format of the output mask file is targeted to a specific platform. The plug-ins that produce each different maskgen output format are called generators. The supported generators are cref, which supports the Java Card RE, and size, which reports size statistics for the mask. Other generators that are not supported in this release include jref, which supports the Java programming language Java Card RE, and a51, which supports the Keil A51 assembly language interpreter.
For more information on the contents of a Java Card Assembly file, see Appendix A.
You invoke maskgen at the command line as follows (see TABLE 10-30 for a description of the options):
maskgen [options] generator filename [filename ...]
| Note - The file to invoke the maskgen is a batch file (maskgen.bat) that must be run from a working directory of JC_CLASSIC_HOME\bin in order for the code to execute properly. |
The Java Card Assembly files that can be listed on the command line can belong to API packages, the installer package, or the user’s library and applet packages. The Java Card Assembly files that belong to API packages must be listed first on the command line, followed by the Java Card Assembly files belonging to any applets.
If you include the installer package’s Java Card Assembly file on the command line, it must be listed after all of the Assembly files belonging to API packages and before the Assembly files of any other applet packages.
maskgen -nobanner cref API_package_1.jca .... API_package_n.jca installer_package.jca applet_package_1.jca ... applet_package_n.jca
The packages that you specify to generate a mask can import other packages. These imported packages must share the same major and minor version number as the specified packages.
For example, presume that you are using Package A, version 1.1 to create a mask, and that Package A imports Package B, version 1.1. Then you must ensure that Package B, version 1.1 is listed in the import component of the Package A .jca file.
This example uses a text file (args.txt) to pass command line arguments to maskgen:
maskgen -o mask.c cref @args.txt
where the contents of the file args.txt is:
first.jca second.jca third.jca
This is equivalent to the command line:
maskgen -o mask.c cref first.jca second.jca third.jca
This command produces an output file mask.c that is compiled with a C compiler to produce mask.o, which is linked with the Java Card RE interpreter. Refer to Chapter 9 for more information about this target platform.
Copyright © 2009 Sun Microsystems, Inc. All rights reserved.