Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:7.5.27_i2s

7.5.27 i2s

Convert int to short

Format

i2s

Forms

i2s = 94 (0x5e)

Stack

…, value.word1, value.word2 → …, result

Description

The value on top of the operand stack must be of type int. It is popped from the operand stack and converted to a short result by taking the low-order 16 bits of the int value and discarding the high-order 16 bits. The result is pushed onto the operand stack.

Notes

The i2s instruction performs a narrowing primitive conversion. It may lose information about the overall magnitude of value. The result may also not have the same sign as value.

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

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