Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:7.5.71_newarray

7.5.71 newarray

Create new array

Format

newarray

atype

Forms

newarray = 144 (0x90)

Stack

…, count → …, arrayref

Description

The count must be of type short. It is popped off the operand stack. The count represents the number of elements in the array to be created.

The unsigned byte atype is a code that indicates the type of array to create. It must take one of the following values:

Array Type

atype

T_BOOLEAN

10

T_BYTE

11

T_SHORT

12

T_INT

13

A new array whose components are of type atype, of length count, is allocated from the heap. A reference arrayref to this new array object is pushed onto the operand stack. All of the elements of the new array are initialized to the default initial value for its type.

Runtime Exception

If count is less than zero, the newarray instruction throws a NegativeArraySizeException.

Notes

If a virtual machine does not support the int data type, the value of atype may not be 13 (array type = T_INT).

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