Site Tools


Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing


7.5.67 iushr

Logical shift right int




iushr = 82 (0x52)


…, value1.word1, value1.word2, value2.word1, value2.word2 → …, result.word1, result.word2


Both value1 and value2 must be of type int. The values are popped from the operand stack. An int result is calculated by shifting the result right by s bit positions, with zero extension, where s is the value of the low five bits of value2. The result is pushed onto the operand stack.


If value1 is positive and s is value2& 0x1f, the result is the same as that of value1 » s; if value1 is negative, the result is equal to the value of the expression (value1 » s) + (2 « ~s). The addition of the (2 « ~s) term cancels out the propagated sign bit. The shift distance actually used is always in the range 0 to 31, inclusive, as if value2 were subjected to a bitwise logical AND with the mask value 0x1f.

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

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