Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:7.5.23_getstatic_t

7.5.23 getstatic_<t>

Get static field from class

Format

getstatic_

indexbyte1

indexbyte2

Forms

getstatic_a = 123 (0x7b) getstatic_b = 124 (0x7c) getstatic_s = 125 (0x7d) getstatic_i = 126 (0x7e)

Stack

… → …, value

OR

… → …, value.word1, value.word2

Description

The unsigned indexbyte1 and indexbyte2 are used to construct an index into the constant pool of the current package ( Section 3.5, Frames), where the value of the index is (indexbyte1 « 8) | indexbyte2. The constant pool item at the index must be of type CONSTANT_StaticFieldref ( Section 6.7.3, CONSTANT_StaticFieldref and CONSTANT_StaticMethodref), a reference to a static field.

The item must resolve to a field with a type that matches t, as follows:

  • a field must be of type reference
  • b field must be of type byte or type boolean
  • s field must be of type short
  • i field must be of type int

The width of a class field is determined by the field type specified in the instruction. The item is resolved, determining the field offset. The item is resolved, determining the class field. The value of the class field is fetched. If the value is of type byte or boolean, it is sign-extended to a short. The value is pushed onto the operand stack.

Notes

If a virtual machine does not support the int data type, the getstatic_i instruction will not be available.

javacard/jcvm/7.5.23_getstatic_t.txt · Last modified: 2017/05/13 04:09 (external edit)